From bde840344418a34f41785c3b62f66d8a33c13587 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Tue, 2 Mar 2021 16:26:49 +0100 Subject: [PATCH] Regenerate client from commit 12c0486 of spec repo (#230) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- data/v1/openapi.yaml | 336 ++++++++++++++++++ docs/v1/README.md | 10 + docs/v1/SyntheticsAPITest.md | 38 ++ docs/v1/SyntheticsAPITestConfig.md | 22 ++ docs/v1/SyntheticsAPITestType.md | 15 + docs/v1/SyntheticsApi.md | 312 ++++++++++++++++ docs/v1/SyntheticsBrowserTest.md | 38 ++ docs/v1/SyntheticsBrowserTestConfig.md | 22 ++ docs/v1/SyntheticsBrowserTestType.md | 15 + features/v1/synthetics.feature | 90 +++++ features/v1/undo.json | 18 + lib/datadog_api_client/v1.rb | 6 + .../v1/api/synthetics_api.rb | 312 ++++++++++++++++ .../v1/models/synthetics_api_test.rb | 324 +++++++++++++++++ .../v1/models/synthetics_api_test_config.rb | 256 +++++++++++++ .../v1/models/synthetics_api_test_type.rb | 39 ++ .../v1/models/synthetics_browser_test.rb | 327 +++++++++++++++++ .../models/synthetics_browser_test_config.rb | 256 +++++++++++++ .../v1/models/synthetics_browser_test_type.rb | 39 ++ .../models/synthetics_api_test_config_spec.rb | 49 +++ spec/v1/models/synthetics_api_test_spec.rb | 97 +++++ .../models/synthetics_api_test_type_spec.rb | 31 ++ .../synthetics_browser_test_config_spec.rb | 49 +++ .../v1/models/synthetics_browser_test_spec.rb | 97 +++++ .../synthetics_browser_test_type_spec.rb | 31 ++ 26 files changed, 2833 insertions(+), 4 deletions(-) create mode 100644 docs/v1/SyntheticsAPITest.md create mode 100644 docs/v1/SyntheticsAPITestConfig.md create mode 100644 docs/v1/SyntheticsAPITestType.md create mode 100644 docs/v1/SyntheticsBrowserTest.md create mode 100644 docs/v1/SyntheticsBrowserTestConfig.md create mode 100644 docs/v1/SyntheticsBrowserTestType.md create mode 100644 lib/datadog_api_client/v1/models/synthetics_api_test.rb create mode 100644 lib/datadog_api_client/v1/models/synthetics_api_test_config.rb create mode 100644 lib/datadog_api_client/v1/models/synthetics_api_test_type.rb create mode 100644 lib/datadog_api_client/v1/models/synthetics_browser_test.rb create mode 100644 lib/datadog_api_client/v1/models/synthetics_browser_test_config.rb create mode 100644 lib/datadog_api_client/v1/models/synthetics_browser_test_type.rb create mode 100644 spec/v1/models/synthetics_api_test_config_spec.rb create mode 100644 spec/v1/models/synthetics_api_test_spec.rb create mode 100644 spec/v1/models/synthetics_api_test_type_spec.rb create mode 100644 spec/v1/models/synthetics_browser_test_config_spec.rb create mode 100644 spec/v1/models/synthetics_browser_test_spec.rb create mode 100644 spec/v1/models/synthetics_browser_test_type_spec.rb diff --git a/.apigentools-info b/.apigentools-info index 8fc667f99dc6..81e0f02a9344 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-03-01 15:46:23.184303", - "spec_repo_commit": "46cbd6f" + "regenerated": "2021-03-02 15:01:16.404114", + "spec_repo_commit": "12c0486" }, "v2": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-03-01 15:46:36.358596", - "spec_repo_commit": "46cbd6f" + "regenerated": "2021-03-02 15:01:30.365868", + "spec_repo_commit": "12c0486" } } } \ No newline at end of file diff --git a/data/v1/openapi.yaml b/data/v1/openapi.yaml index 2938f9d8b422..2cd74effd61a 100644 --- a/data/v1/openapi.yaml +++ b/data/v1/openapi.yaml @@ -6291,6 +6291,66 @@ components: items: $ref: '#/components/schemas/SlackIntegrationChannel' type: array + SyntheticsAPITest: + description: Object containing details about a Synthetic API test. + properties: + config: + $ref: '#/components/schemas/SyntheticsAPITestConfig' + locations: + description: Array of locations used to run the test. + items: + description: A location from which the test was run. + type: string + type: array + message: + description: Notification message associated with the test. + type: string + monitor_id: + description: The associated monitor ID. + format: int64 + type: integer + name: + description: Name of the test. + type: string + options: + $ref: '#/components/schemas/SyntheticsTestOptions' + public_id: + description: The public ID for the test. + type: string + status: + $ref: '#/components/schemas/SyntheticsTestPauseStatus' + subtype: + $ref: '#/components/schemas/SyntheticsTestDetailsSubType' + tags: + description: Array of tags attached to the test. + items: + description: A tag attached to the test. + type: string + type: array + type: + $ref: '#/components/schemas/SyntheticsAPITestType' + type: object + SyntheticsAPITestConfig: + description: Configuration object for a Synthetic API test. + properties: + assertions: + default: [] + description: Array of assertions used for the test. + example: [] + items: + $ref: '#/components/schemas/SyntheticsAssertion' + type: array + configVariables: + description: Array of variables used for the test. + items: + $ref: '#/components/schemas/SyntheticsConfigVariable' + type: array + request: + $ref: '#/components/schemas/SyntheticsTestRequest' + required: + - request + - assertions + type: object SyntheticsAPITestResultData: description: Object containing results for your Synthetic API test. properties: @@ -6381,6 +6441,15 @@ components: status: $ref: '#/components/schemas/SyntheticsTestMonitorStatus' type: object + SyntheticsAPITestType: + default: api + description: Type of the Synthetic test, `api`. + enum: + - api + example: api + type: string + x-enum-varnames: + - API SyntheticsAssertion: description: 'Object describing the assertions type, their associated operator, @@ -6543,6 +6612,69 @@ components: x-enum-varnames: - NETWORK - JS + SyntheticsBrowserTest: + description: Object containing details about a Synthetic browser test. + properties: + config: + $ref: '#/components/schemas/SyntheticsBrowserTestConfig' + locations: + description: Array of locations used to run the test. + items: + description: A location from which the test was run. + type: string + type: array + message: + description: Notification message associated with the test. + type: string + monitor_id: + description: The associated monitor ID. + format: int64 + type: integer + name: + description: Name of the test. + type: string + options: + $ref: '#/components/schemas/SyntheticsTestOptions' + public_id: + description: The public ID of the test. + type: string + status: + $ref: '#/components/schemas/SyntheticsTestPauseStatus' + steps: + description: The steps of the test. + items: + $ref: '#/components/schemas/SyntheticsStep' + type: array + tags: + description: Array of tags attached to the test. + items: + description: A tag attached to the test. + type: string + type: array + type: + $ref: '#/components/schemas/SyntheticsBrowserTestType' + type: object + SyntheticsBrowserTestConfig: + description: Configuration object for a Synthetic browser test. + properties: + assertions: + default: [] + description: Array of assertions used for the test. + example: [] + items: + $ref: '#/components/schemas/SyntheticsAssertion' + type: array + request: + $ref: '#/components/schemas/SyntheticsTestRequest' + variables: + description: Array of variables used for the test steps. + items: + $ref: '#/components/schemas/SyntheticsBrowserVariable' + type: array + required: + - request + - assertions + type: object SyntheticsBrowserTestResultData: description: Object containing results for your Synthetic browser test. properties: @@ -6657,6 +6789,15 @@ components: - from_ts - to_ts type: object + SyntheticsBrowserTestType: + default: browser + description: Type of the Synthetic test, `browser`. + enum: + - browser + example: browser + type: string + x-enum-varnames: + - BROWSER SyntheticsBrowserVariable: description: 'Object defining a variable that can be used in your browser test. @@ -16004,6 +16145,7 @@ paths: x-undo: type: safe post: + deprecated: true description: Create a Synthetic test. operationId: CreateTest requestBody: @@ -16048,6 +16190,145 @@ paths: operationId: TODO parameters: [] type: unsafe + /api/v1/synthetics/tests/api: + post: + description: Create a Synthetic API test. + operationId: CreateSyntheticsAPITest + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsAPITest' + description: Details of the test to create. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsAPITest' + description: OK - Returns the created test details. + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- JSON format is wrong + + - Creation failed' + '402': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Test quota is reached + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Create an API test + tags: + - Synthetics + x-codegen-request-body-name: body + /api/v1/synthetics/tests/api/{public_id}: + put: + description: Edit the configuration of a Synthetic API test. + operationId: UpdateAPITest + parameters: + - description: The public ID of the test to get details from. + in: path + name: public_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsAPITest' + description: New test details to be saved. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsAPITest' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- JSON format is wrong + + - Updating sub-type is forbidden' + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- Synthetic Monitoring is not activated for the user + + - Test is not owned by the user + + - Test can''t be found' + summary: Edit an API test + tags: + - Synthetics + x-codegen-request-body-name: body + x-undo: + type: idempotent + /api/v1/synthetics/tests/browser: + post: + description: Create a Synthetic browser test. + operationId: CreateSyntheticsBrowserTest + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsBrowserTest' + description: Details of the test to create. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsBrowserTest' + description: OK - Returns the created test details. + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- JSON format is wrong + + - Creation failed' + '402': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Test quota is reached + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Create a browser test + tags: + - Synthetics + x-codegen-request-body-name: body /api/v1/synthetics/tests/browser/{public_id}: get: description: 'Get the detailed configuration (including steps) associated with @@ -16087,6 +16368,60 @@ paths: - Synthetics x-undo: type: safe + put: + description: Edit the configuration of a Synthetic browser test. + operationId: UpdateBrowserTest + parameters: + - description: The public ID of the test to get details from. + in: path + name: public_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsBrowserTest' + description: New test details to be saved. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsBrowserTest' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- JSON format is wrong + + - Updating sub-type is forbidden' + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: '- Synthetic Monitoring is not activated for the user + + - Test is not owned by the user + + - Test can''t be found' + summary: Edit a browser test + tags: + - Synthetics + x-codegen-request-body-name: body + x-undo: + type: idempotent /api/v1/synthetics/tests/browser/{public_id}/results: get: description: Get the last 50 test results summaries for a given Synthetics Browser @@ -16312,6 +16647,7 @@ paths: x-undo: type: safe put: + deprecated: true description: Edit the configuration of a Synthetic test. operationId: UpdateTest parameters: diff --git a/docs/v1/README.md b/docs/v1/README.md index c90146f48d1f..94f43e2779f1 100644 --- a/docs/v1/README.md +++ b/docs/v1/README.md @@ -200,6 +200,8 @@ Class | Method | HTTP request | Description *DatadogAPIClient::V1::SnapshotsApi* | [**get_graph_snapshot**](SnapshotsApi.md#get_graph_snapshot) | **GET** /api/v1/graph/snapshot | Take graph snapshots *DatadogAPIClient::V1::SyntheticsApi* | [**create_global_variable**](SyntheticsApi.md#create_global_variable) | **POST** /api/v1/synthetics/variables | Create a global variable *DatadogAPIClient::V1::SyntheticsApi* | [**create_private_location**](SyntheticsApi.md#create_private_location) | **POST** /api/v1/synthetics/private-locations | Create a private location +*DatadogAPIClient::V1::SyntheticsApi* | [**create_synthetics_api_test**](SyntheticsApi.md#create_synthetics_api_test) | **POST** /api/v1/synthetics/tests/api | Create an API test +*DatadogAPIClient::V1::SyntheticsApi* | [**create_synthetics_browser_test**](SyntheticsApi.md#create_synthetics_browser_test) | **POST** /api/v1/synthetics/tests/browser | Create a browser test *DatadogAPIClient::V1::SyntheticsApi* | [**create_test**](SyntheticsApi.md#create_test) | **POST** /api/v1/synthetics/tests | Create a test *DatadogAPIClient::V1::SyntheticsApi* | [**delete_global_variable**](SyntheticsApi.md#delete_global_variable) | **DELETE** /api/v1/synthetics/variables/{variable_id} | Delete a global variable *DatadogAPIClient::V1::SyntheticsApi* | [**delete_private_location**](SyntheticsApi.md#delete_private_location) | **DELETE** /api/v1/synthetics/private-locations/{location_id} | Delete a private location @@ -216,6 +218,8 @@ Class | Method | HTTP request | Description *DatadogAPIClient::V1::SyntheticsApi* | [**list_locations**](SyntheticsApi.md#list_locations) | **GET** /api/v1/synthetics/locations | Get all locations (public and private) *DatadogAPIClient::V1::SyntheticsApi* | [**list_tests**](SyntheticsApi.md#list_tests) | **GET** /api/v1/synthetics/tests | Get the list of all tests *DatadogAPIClient::V1::SyntheticsApi* | [**trigger_ci_tests**](SyntheticsApi.md#trigger_ci_tests) | **POST** /api/v1/synthetics/tests/trigger/ci | Trigger some Synthetics tests for CI +*DatadogAPIClient::V1::SyntheticsApi* | [**update_api_test**](SyntheticsApi.md#update_api_test) | **PUT** /api/v1/synthetics/tests/api/{public_id} | Edit an API test +*DatadogAPIClient::V1::SyntheticsApi* | [**update_browser_test**](SyntheticsApi.md#update_browser_test) | **PUT** /api/v1/synthetics/tests/browser/{public_id} | Edit a browser test *DatadogAPIClient::V1::SyntheticsApi* | [**update_private_location**](SyntheticsApi.md#update_private_location) | **PUT** /api/v1/synthetics/private-locations/{location_id} | Edit a private location *DatadogAPIClient::V1::SyntheticsApi* | [**update_test**](SyntheticsApi.md#update_test) | **PUT** /api/v1/synthetics/tests/{public_id} | Edit a test *DatadogAPIClient::V1::SyntheticsApi* | [**update_test_pause_status**](SyntheticsApi.md#update_test_pause_status) | **PUT** /api/v1/synthetics/tests/{public_id}/status | Pause or start a test @@ -534,11 +538,14 @@ Class | Method | HTTP request | Description - [DatadogAPIClient::V1::ServiceSummaryWidgetDefinitionType](ServiceSummaryWidgetDefinitionType.md) - [DatadogAPIClient::V1::SlackIntegrationChannel](SlackIntegrationChannel.md) - [DatadogAPIClient::V1::SlackIntegrationChannelDisplay](SlackIntegrationChannelDisplay.md) + - [DatadogAPIClient::V1::SyntheticsAPITest](SyntheticsAPITest.md) + - [DatadogAPIClient::V1::SyntheticsAPITestConfig](SyntheticsAPITestConfig.md) - [DatadogAPIClient::V1::SyntheticsAPITestResultData](SyntheticsAPITestResultData.md) - [DatadogAPIClient::V1::SyntheticsAPITestResultFull](SyntheticsAPITestResultFull.md) - [DatadogAPIClient::V1::SyntheticsAPITestResultFullCheck](SyntheticsAPITestResultFullCheck.md) - [DatadogAPIClient::V1::SyntheticsAPITestResultShort](SyntheticsAPITestResultShort.md) - [DatadogAPIClient::V1::SyntheticsAPITestResultShortResult](SyntheticsAPITestResultShortResult.md) + - [DatadogAPIClient::V1::SyntheticsAPITestType](SyntheticsAPITestType.md) - [DatadogAPIClient::V1::SyntheticsAssertion](SyntheticsAssertion.md) - [DatadogAPIClient::V1::SyntheticsAssertionJSONPathOperator](SyntheticsAssertionJSONPathOperator.md) - [DatadogAPIClient::V1::SyntheticsAssertionJSONPathTarget](SyntheticsAssertionJSONPathTarget.md) @@ -549,11 +556,14 @@ Class | Method | HTTP request | Description - [DatadogAPIClient::V1::SyntheticsBasicAuth](SyntheticsBasicAuth.md) - [DatadogAPIClient::V1::SyntheticsBrowserError](SyntheticsBrowserError.md) - [DatadogAPIClient::V1::SyntheticsBrowserErrorType](SyntheticsBrowserErrorType.md) + - [DatadogAPIClient::V1::SyntheticsBrowserTest](SyntheticsBrowserTest.md) + - [DatadogAPIClient::V1::SyntheticsBrowserTestConfig](SyntheticsBrowserTestConfig.md) - [DatadogAPIClient::V1::SyntheticsBrowserTestResultData](SyntheticsBrowserTestResultData.md) - [DatadogAPIClient::V1::SyntheticsBrowserTestResultFull](SyntheticsBrowserTestResultFull.md) - [DatadogAPIClient::V1::SyntheticsBrowserTestResultFullCheck](SyntheticsBrowserTestResultFullCheck.md) - [DatadogAPIClient::V1::SyntheticsBrowserTestResultShort](SyntheticsBrowserTestResultShort.md) - [DatadogAPIClient::V1::SyntheticsBrowserTestResultShortResult](SyntheticsBrowserTestResultShortResult.md) + - [DatadogAPIClient::V1::SyntheticsBrowserTestType](SyntheticsBrowserTestType.md) - [DatadogAPIClient::V1::SyntheticsBrowserVariable](SyntheticsBrowserVariable.md) - [DatadogAPIClient::V1::SyntheticsBrowserVariableType](SyntheticsBrowserVariableType.md) - [DatadogAPIClient::V1::SyntheticsCITest](SyntheticsCITest.md) diff --git a/docs/v1/SyntheticsAPITest.md b/docs/v1/SyntheticsAPITest.md new file mode 100644 index 000000000000..49bf422042d8 --- /dev/null +++ b/docs/v1/SyntheticsAPITest.md @@ -0,0 +1,38 @@ +# DatadogAPIClient::V1::SyntheticsAPITest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **config** | [**SyntheticsAPITestConfig**](SyntheticsAPITestConfig.md) | | [optional] | +| **locations** | **Array<String>** | Array of locations used to run the test. | [optional] | +| **message** | **String** | Notification message associated with the test. | [optional] | +| **monitor_id** | **Integer** | The associated monitor ID. | [optional] | +| **name** | **String** | Name of the test. | [optional] | +| **options** | [**SyntheticsTestOptions**](SyntheticsTestOptions.md) | | [optional] | +| **public_id** | **String** | The public ID for the test. | [optional] | +| **status** | [**SyntheticsTestPauseStatus**](SyntheticsTestPauseStatus.md) | | [optional] | +| **subtype** | [**SyntheticsTestDetailsSubType**](SyntheticsTestDetailsSubType.md) | | [optional] | +| **tags** | **Array<String>** | Array of tags attached to the test. | [optional] | +| **type** | [**SyntheticsAPITestType**](SyntheticsAPITestType.md) | | [optional][default to 'api'] | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::SyntheticsAPITest.new( + config: null, + locations: null, + message: null, + monitor_id: null, + name: null, + options: null, + public_id: null, + status: null, + subtype: null, + tags: null, + type: null +) +``` + diff --git a/docs/v1/SyntheticsAPITestConfig.md b/docs/v1/SyntheticsAPITestConfig.md new file mode 100644 index 000000000000..c0f6c6499068 --- /dev/null +++ b/docs/v1/SyntheticsAPITestConfig.md @@ -0,0 +1,22 @@ +# DatadogAPIClient::V1::SyntheticsAPITestConfig + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **assertions** | [**Array<SyntheticsAssertion>**](SyntheticsAssertion.md) | Array of assertions used for the test. | | +| **config_variables** | [**Array<SyntheticsConfigVariable>**](SyntheticsConfigVariable.md) | Array of variables used for the test. | [optional] | +| **request** | [**SyntheticsTestRequest**](SyntheticsTestRequest.md) | | | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::SyntheticsAPITestConfig.new( + assertions: [], + config_variables: null, + request: null +) +``` + diff --git a/docs/v1/SyntheticsAPITestType.md b/docs/v1/SyntheticsAPITestType.md new file mode 100644 index 000000000000..fbe042d16566 --- /dev/null +++ b/docs/v1/SyntheticsAPITestType.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V1::SyntheticsAPITestType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::SyntheticsAPITestType.new() +``` + diff --git a/docs/v1/SyntheticsApi.md b/docs/v1/SyntheticsApi.md index 00b3aced433e..1c5c9829dd02 100644 --- a/docs/v1/SyntheticsApi.md +++ b/docs/v1/SyntheticsApi.md @@ -6,6 +6,8 @@ All URIs are relative to *https://api.datadoghq.com* | ------ | ------------ | ----------- | | [**create_global_variable**](SyntheticsApi.md#create_global_variable) | **POST** /api/v1/synthetics/variables | Create a global variable | | [**create_private_location**](SyntheticsApi.md#create_private_location) | **POST** /api/v1/synthetics/private-locations | Create a private location | +| [**create_synthetics_api_test**](SyntheticsApi.md#create_synthetics_api_test) | **POST** /api/v1/synthetics/tests/api | Create an API test | +| [**create_synthetics_browser_test**](SyntheticsApi.md#create_synthetics_browser_test) | **POST** /api/v1/synthetics/tests/browser | Create a browser test | | [**create_test**](SyntheticsApi.md#create_test) | **POST** /api/v1/synthetics/tests | Create a test | | [**delete_global_variable**](SyntheticsApi.md#delete_global_variable) | **DELETE** /api/v1/synthetics/variables/{variable_id} | Delete a global variable | | [**delete_private_location**](SyntheticsApi.md#delete_private_location) | **DELETE** /api/v1/synthetics/private-locations/{location_id} | Delete a private location | @@ -22,6 +24,8 @@ All URIs are relative to *https://api.datadoghq.com* | [**list_locations**](SyntheticsApi.md#list_locations) | **GET** /api/v1/synthetics/locations | Get all locations (public and private) | | [**list_tests**](SyntheticsApi.md#list_tests) | **GET** /api/v1/synthetics/tests | Get the list of all tests | | [**trigger_ci_tests**](SyntheticsApi.md#trigger_ci_tests) | **POST** /api/v1/synthetics/tests/trigger/ci | Trigger some Synthetics tests for CI | +| [**update_api_test**](SyntheticsApi.md#update_api_test) | **PUT** /api/v1/synthetics/tests/api/{public_id} | Edit an API test | +| [**update_browser_test**](SyntheticsApi.md#update_browser_test) | **PUT** /api/v1/synthetics/tests/browser/{public_id} | Edit a browser test | | [**update_private_location**](SyntheticsApi.md#update_private_location) | **PUT** /api/v1/synthetics/private-locations/{location_id} | Edit a private location | | [**update_test**](SyntheticsApi.md#update_test) | **PUT** /api/v1/synthetics/tests/{public_id} | Edit a test | | [**update_test_pause_status**](SyntheticsApi.md#update_test_pause_status) | **PUT** /api/v1/synthetics/tests/{public_id}/status | Pause or start a test | @@ -179,6 +183,158 @@ end - **Accept**: application/json +## create_synthetics_api_test + +> create_synthetics_api_test(body) + +Create an API test + +Create a Synthetic API test. + +### Examples + +```ruby +require 'time' +require 'datadog_api_client' + +DatadogAPIClient::V1.configure do |config| + # Defining the site is optional and defaults to datadoghq.com + config.server_variables['site'] = ENV["DD_SITE"] if ENV.key? 'DD_SITE' + + # setup authorization + # Configure API key authorization: apiKeyAuth + config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"] + + # Configure API key authorization: appKeyAuth + config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"] +end + +api_instance = DatadogAPIClient::V1::SyntheticsApi.new +body = DatadogAPIClient::V1::SyntheticsAPITest.new # SyntheticsAPITest | Details of the test to create. + +begin + # Create an API test + result = api_instance.create_synthetics_api_test(body) + p result +rescue DatadogAPIClient::V1::ApiError => e + puts "Error when calling SyntheticsApi->create_synthetics_api_test: #{e}" +end +``` + +#### Using the create_synthetics_api_test_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_synthetics_api_test_with_http_info(body) + +```ruby +begin + # Create an API test + data, status_code, headers = api_instance.create_synthetics_api_test_with_http_info(body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue DatadogAPIClient::V1::ApiError => e + puts "Error when calling SyntheticsApi->create_synthetics_api_test_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **body** | [**SyntheticsAPITest**](SyntheticsAPITest.md) | Details of the test to create. | | + +### Return type + +[**SyntheticsAPITest**](SyntheticsAPITest.md) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_synthetics_browser_test + +> create_synthetics_browser_test(body) + +Create a browser test + +Create a Synthetic browser test. + +### Examples + +```ruby +require 'time' +require 'datadog_api_client' + +DatadogAPIClient::V1.configure do |config| + # Defining the site is optional and defaults to datadoghq.com + config.server_variables['site'] = ENV["DD_SITE"] if ENV.key? 'DD_SITE' + + # setup authorization + # Configure API key authorization: apiKeyAuth + config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"] + + # Configure API key authorization: appKeyAuth + config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"] +end + +api_instance = DatadogAPIClient::V1::SyntheticsApi.new +body = DatadogAPIClient::V1::SyntheticsBrowserTest.new # SyntheticsBrowserTest | Details of the test to create. + +begin + # Create a browser test + result = api_instance.create_synthetics_browser_test(body) + p result +rescue DatadogAPIClient::V1::ApiError => e + puts "Error when calling SyntheticsApi->create_synthetics_browser_test: #{e}" +end +``` + +#### Using the create_synthetics_browser_test_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> create_synthetics_browser_test_with_http_info(body) + +```ruby +begin + # Create a browser test + data, status_code, headers = api_instance.create_synthetics_browser_test_with_http_info(body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue DatadogAPIClient::V1::ApiError => e + puts "Error when calling SyntheticsApi->create_synthetics_browser_test_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **body** | [**SyntheticsBrowserTest**](SyntheticsBrowserTest.md) | Details of the test to create. | | + +### Return type + +[**SyntheticsBrowserTest**](SyntheticsBrowserTest.md) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## create_test > create_test(body) @@ -1409,6 +1565,162 @@ end - **Accept**: application/json +## update_api_test + +> update_api_test(public_id, body) + +Edit an API test + +Edit the configuration of a Synthetic API test. + +### Examples + +```ruby +require 'time' +require 'datadog_api_client' + +DatadogAPIClient::V1.configure do |config| + # Defining the site is optional and defaults to datadoghq.com + config.server_variables['site'] = ENV["DD_SITE"] if ENV.key? 'DD_SITE' + + # setup authorization + # Configure API key authorization: apiKeyAuth + config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"] + + # Configure API key authorization: appKeyAuth + config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"] +end + +api_instance = DatadogAPIClient::V1::SyntheticsApi.new +public_id = 'public_id_example' # String | The public ID of the test to get details from. +body = DatadogAPIClient::V1::SyntheticsAPITest.new # SyntheticsAPITest | New test details to be saved. + +begin + # Edit an API test + result = api_instance.update_api_test(public_id, body) + p result +rescue DatadogAPIClient::V1::ApiError => e + puts "Error when calling SyntheticsApi->update_api_test: #{e}" +end +``` + +#### Using the update_api_test_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_api_test_with_http_info(public_id, body) + +```ruby +begin + # Edit an API test + data, status_code, headers = api_instance.update_api_test_with_http_info(public_id, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue DatadogAPIClient::V1::ApiError => e + puts "Error when calling SyntheticsApi->update_api_test_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **public_id** | **String** | The public ID of the test to get details from. | | +| **body** | [**SyntheticsAPITest**](SyntheticsAPITest.md) | New test details to be saved. | | + +### Return type + +[**SyntheticsAPITest**](SyntheticsAPITest.md) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_browser_test + +> update_browser_test(public_id, body) + +Edit a browser test + +Edit the configuration of a Synthetic browser test. + +### Examples + +```ruby +require 'time' +require 'datadog_api_client' + +DatadogAPIClient::V1.configure do |config| + # Defining the site is optional and defaults to datadoghq.com + config.server_variables['site'] = ENV["DD_SITE"] if ENV.key? 'DD_SITE' + + # setup authorization + # Configure API key authorization: apiKeyAuth + config.api_key['apiKeyAuth'] = ENV["DD_CLIENT_API_KEY"] + + # Configure API key authorization: appKeyAuth + config.api_key['appKeyAuth'] = ENV["DD_CLIENT_APP_KEY"] +end + +api_instance = DatadogAPIClient::V1::SyntheticsApi.new +public_id = 'public_id_example' # String | The public ID of the test to get details from. +body = DatadogAPIClient::V1::SyntheticsBrowserTest.new # SyntheticsBrowserTest | New test details to be saved. + +begin + # Edit a browser test + result = api_instance.update_browser_test(public_id, body) + p result +rescue DatadogAPIClient::V1::ApiError => e + puts "Error when calling SyntheticsApi->update_browser_test: #{e}" +end +``` + +#### Using the update_browser_test_with_http_info variant + +This returns an Array which contains the response data, status code and headers. + +> , Integer, Hash)> update_browser_test_with_http_info(public_id, body) + +```ruby +begin + # Edit a browser test + data, status_code, headers = api_instance.update_browser_test_with_http_info(public_id, body) + p status_code # => 2xx + p headers # => { ... } + p data # => +rescue DatadogAPIClient::V1::ApiError => e + puts "Error when calling SyntheticsApi->update_browser_test_with_http_info: #{e}" +end +``` + +### Parameters + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **public_id** | **String** | The public ID of the test to get details from. | | +| **body** | [**SyntheticsBrowserTest**](SyntheticsBrowserTest.md) | New test details to be saved. | | + +### Return type + +[**SyntheticsBrowserTest**](SyntheticsBrowserTest.md) + +### Authorization + +[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + ## update_private_location > update_private_location(location_id, body) diff --git a/docs/v1/SyntheticsBrowserTest.md b/docs/v1/SyntheticsBrowserTest.md new file mode 100644 index 000000000000..0b30d70b1da5 --- /dev/null +++ b/docs/v1/SyntheticsBrowserTest.md @@ -0,0 +1,38 @@ +# DatadogAPIClient::V1::SyntheticsBrowserTest + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **config** | [**SyntheticsBrowserTestConfig**](SyntheticsBrowserTestConfig.md) | | [optional] | +| **locations** | **Array<String>** | Array of locations used to run the test. | [optional] | +| **message** | **String** | Notification message associated with the test. | [optional] | +| **monitor_id** | **Integer** | The associated monitor ID. | [optional] | +| **name** | **String** | Name of the test. | [optional] | +| **options** | [**SyntheticsTestOptions**](SyntheticsTestOptions.md) | | [optional] | +| **public_id** | **String** | The public ID of the test. | [optional] | +| **status** | [**SyntheticsTestPauseStatus**](SyntheticsTestPauseStatus.md) | | [optional] | +| **steps** | [**Array<SyntheticsStep>**](SyntheticsStep.md) | The steps of the test. | [optional] | +| **tags** | **Array<String>** | Array of tags attached to the test. | [optional] | +| **type** | [**SyntheticsBrowserTestType**](SyntheticsBrowserTestType.md) | | [optional][default to 'browser'] | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::SyntheticsBrowserTest.new( + config: null, + locations: null, + message: null, + monitor_id: null, + name: null, + options: null, + public_id: null, + status: null, + steps: null, + tags: null, + type: null +) +``` + diff --git a/docs/v1/SyntheticsBrowserTestConfig.md b/docs/v1/SyntheticsBrowserTestConfig.md new file mode 100644 index 000000000000..e8ef58500eb6 --- /dev/null +++ b/docs/v1/SyntheticsBrowserTestConfig.md @@ -0,0 +1,22 @@ +# DatadogAPIClient::V1::SyntheticsBrowserTestConfig + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **assertions** | [**Array<SyntheticsAssertion>**](SyntheticsAssertion.md) | Array of assertions used for the test. | | +| **request** | [**SyntheticsTestRequest**](SyntheticsTestRequest.md) | | | +| **variables** | [**Array<SyntheticsBrowserVariable>**](SyntheticsBrowserVariable.md) | Array of variables used for the test steps. | [optional] | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::SyntheticsBrowserTestConfig.new( + assertions: [], + request: null, + variables: null +) +``` + diff --git a/docs/v1/SyntheticsBrowserTestType.md b/docs/v1/SyntheticsBrowserTestType.md new file mode 100644 index 000000000000..2d8a553518a9 --- /dev/null +++ b/docs/v1/SyntheticsBrowserTestType.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V1::SyntheticsBrowserTestType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::SyntheticsBrowserTestType.new() +``` + diff --git a/features/v1/synthetics.feature b/features/v1/synthetics.feature index e4a1ccef2af9..d0c065c4b7f9 100644 --- a/features/v1/synthetics.feature +++ b/features/v1/synthetics.feature @@ -15,6 +15,27 @@ Feature: Synthetics And a valid "appKeyAuth" key in the system And an instance of "Synthetics" API + @generated @skip + Scenario: Create a browser test returns "- JSON format is wrong" response + Given new "CreateSyntheticsBrowserTest" request + And body {} + When the request is sent + Then the response status is 400 - JSON format is wrong + + @generated @skip + Scenario: Create a browser test returns "OK - Returns the created test details." response + Given new "CreateSyntheticsBrowserTest" request + And body {} + When the request is sent + Then the response status is 200 OK - Returns the created test details. + + @generated @skip + Scenario: Create a browser test returns "Test quota is reached" response + Given new "CreateSyntheticsBrowserTest" request + And body {} + When the request is sent + Then the response status is 402 Test quota is reached + @generated @skip Scenario: Create a global variable returns "Invalid request" response Given new "CreateGlobalVariable" request @@ -71,6 +92,27 @@ Feature: Synthetics When the request is sent Then the response status is 402 Test quota is reached + @generated @skip + Scenario: Create an API test returns "- JSON format is wrong" response + Given new "CreateSyntheticsAPITest" request + And body {} + When the request is sent + Then the response status is 400 - JSON format is wrong + + @generated @skip + Scenario: Create an API test returns "OK - Returns the created test details." response + Given new "CreateSyntheticsAPITest" request + And body {} + When the request is sent + Then the response status is 200 OK - Returns the created test details. + + @generated @skip + Scenario: Create an API test returns "Test quota is reached" response + Given new "CreateSyntheticsAPITest" request + And body {} + When the request is sent + Then the response status is 402 Test quota is reached + @generated @skip Scenario: Delete a global variable returns "JSON format is wrong" response Given new "DeleteGlobalVariable" request @@ -127,6 +169,30 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK. + @generated @skip + Scenario: Edit a browser test returns "- JSON format is wrong" response + Given new "UpdateBrowserTest" request + And request contains "public_id" parameter from "" + And body {} + When the request is sent + Then the response status is 400 - JSON format is wrong + + @generated @skip + 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 "" + And body {} + When the request is sent + Then the response status is 404 - Synthetic Monitoring is not activated for the user + + @generated @skip + Scenario: Edit a browser test returns "OK" response + Given new "UpdateBrowserTest" request + And request contains "public_id" parameter from "" + And body {} + When the request is sent + Then the response status is 200 OK + @generated @skip Scenario: Edit a global variable returns "Invalid request" response Given new "EditGlobalVariable" request @@ -183,6 +249,30 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip + Scenario: Edit an API test returns "- JSON format is wrong" response + Given new "UpdateAPITest" request + And request contains "public_id" parameter from "" + And body {} + When the request is sent + Then the response status is 400 - JSON format is wrong + + @generated @skip + 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 "" + And body {} + When the request is sent + Then the response status is 404 - Synthetic Monitoring is not activated for the user + + @generated @skip + Scenario: Edit an API test returns "OK" response + Given new "UpdateAPITest" request + And request contains "public_id" parameter from "" + And body {} + When the request is sent + Then the response status is 200 OK + @generated @skip Scenario: Get a global variable returns "Not found" response Given new "GetGlobalVariable" request diff --git a/features/v1/undo.json b/features/v1/undo.json index 95d2232f2fb4..3999bc525e44 100644 --- a/features/v1/undo.json +++ b/features/v1/undo.json @@ -826,12 +826,30 @@ "type": "unsafe" } }, + "CreateSyntheticsAPITest": { + "tag": "Synthetics" + }, + "UpdateAPITest": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, + "CreateSyntheticsBrowserTest": { + "tag": "Synthetics" + }, "GetBrowserTest": { "tag": "Synthetics", "undo": { "type": "safe" } }, + "UpdateBrowserTest": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, "GetBrowserTestLatestResults": { "tag": "Synthetics", "undo": { diff --git a/lib/datadog_api_client/v1.rb b/lib/datadog_api_client/v1.rb index 343c10c9ff57..4b2eed7c05f7 100644 --- a/lib/datadog_api_client/v1.rb +++ b/lib/datadog_api_client/v1.rb @@ -292,11 +292,14 @@ require 'datadog_api_client/v1/models/service_summary_widget_definition_type' require 'datadog_api_client/v1/models/slack_integration_channel' require 'datadog_api_client/v1/models/slack_integration_channel_display' +require 'datadog_api_client/v1/models/synthetics_api_test' +require 'datadog_api_client/v1/models/synthetics_api_test_config' require 'datadog_api_client/v1/models/synthetics_api_test_result_data' require 'datadog_api_client/v1/models/synthetics_api_test_result_full' require 'datadog_api_client/v1/models/synthetics_api_test_result_full_check' require 'datadog_api_client/v1/models/synthetics_api_test_result_short' require 'datadog_api_client/v1/models/synthetics_api_test_result_short_result' +require 'datadog_api_client/v1/models/synthetics_api_test_type' require 'datadog_api_client/v1/models/synthetics_assertion' require 'datadog_api_client/v1/models/synthetics_assertion_json_path_operator' require 'datadog_api_client/v1/models/synthetics_assertion_json_path_target' @@ -307,11 +310,14 @@ require 'datadog_api_client/v1/models/synthetics_basic_auth' require 'datadog_api_client/v1/models/synthetics_browser_error' require 'datadog_api_client/v1/models/synthetics_browser_error_type' +require 'datadog_api_client/v1/models/synthetics_browser_test' +require 'datadog_api_client/v1/models/synthetics_browser_test_config' require 'datadog_api_client/v1/models/synthetics_browser_test_result_data' require 'datadog_api_client/v1/models/synthetics_browser_test_result_full' require 'datadog_api_client/v1/models/synthetics_browser_test_result_full_check' require 'datadog_api_client/v1/models/synthetics_browser_test_result_short' require 'datadog_api_client/v1/models/synthetics_browser_test_result_short_result' +require 'datadog_api_client/v1/models/synthetics_browser_test_type' require 'datadog_api_client/v1/models/synthetics_browser_variable' require 'datadog_api_client/v1/models/synthetics_browser_variable_type' require 'datadog_api_client/v1/models/synthetics_ci_test' diff --git a/lib/datadog_api_client/v1/api/synthetics_api.rb b/lib/datadog_api_client/v1/api/synthetics_api.rb index 8e15428a92e7..604d3d368ba4 100644 --- a/lib/datadog_api_client/v1/api/synthetics_api.rb +++ b/lib/datadog_api_client/v1/api/synthetics_api.rb @@ -172,6 +172,156 @@ def create_private_location_with_http_info(body, opts = {}) return data, status_code, headers end + # Create an API test + # Create a Synthetic API test. + # @param body [SyntheticsAPITest] Details of the test to create. + # @param [Hash] opts the optional parameters + # @return [SyntheticsAPITest] + def create_synthetics_api_test(body, opts = {}) + data, _status_code, _headers = create_synthetics_api_test_with_http_info(body, opts) + data + end + + # Create an API test + # Create a Synthetic API test. + # @param body [SyntheticsAPITest] Details of the test to create. + # @param [Hash] opts the optional parameters + # @return [Array<(SyntheticsAPITest, Integer, Hash)>] SyntheticsAPITest data, response status code and response headers + def create_synthetics_api_test_with_http_info(body, opts = {}) + + if @api_client.config.unstable_operations.has_key?(:create_synthetics_api_test) + unstable_enabled = @api_client.config.unstable_operations[:create_synthetics_api_test] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "create_synthetics_api_test") + else + raise ApiError.new(message: format("Unstable operation '%s' is disabled", "create_synthetics_api_test")) + end + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsApi.create_synthetics_api_test ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsApi.create_synthetics_api_test" + end + # resource path + local_var_path = '/api/v1/synthetics/tests/api' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsAPITest' + + # auth_names + auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'appKeyAuth'] + + new_options = opts.merge( + :operation => :"SyntheticsApi.create_synthetics_api_test", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsApi#create_synthetics_api_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a browser test + # Create a Synthetic browser test. + # @param body [SyntheticsBrowserTest] Details of the test to create. + # @param [Hash] opts the optional parameters + # @return [SyntheticsBrowserTest] + def create_synthetics_browser_test(body, opts = {}) + data, _status_code, _headers = create_synthetics_browser_test_with_http_info(body, opts) + data + end + + # Create a browser test + # Create a Synthetic browser test. + # @param body [SyntheticsBrowserTest] Details of the test to create. + # @param [Hash] opts the optional parameters + # @return [Array<(SyntheticsBrowserTest, Integer, Hash)>] SyntheticsBrowserTest data, response status code and response headers + def create_synthetics_browser_test_with_http_info(body, opts = {}) + + if @api_client.config.unstable_operations.has_key?(:create_synthetics_browser_test) + unstable_enabled = @api_client.config.unstable_operations[:create_synthetics_browser_test] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "create_synthetics_browser_test") + else + raise ApiError.new(message: format("Unstable operation '%s' is disabled", "create_synthetics_browser_test")) + end + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsApi.create_synthetics_browser_test ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsApi.create_synthetics_browser_test" + end + # resource path + local_var_path = '/api/v1/synthetics/tests/browser' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsBrowserTest' + + # auth_names + auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'appKeyAuth'] + + new_options = opts.merge( + :operation => :"SyntheticsApi.create_synthetics_browser_test", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsApi#create_synthetics_browser_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a test # Create a Synthetic test. # @param body [SyntheticsTestDetails] Details of the test to create. @@ -1372,6 +1522,168 @@ def trigger_ci_tests_with_http_info(body, opts = {}) return data, status_code, headers end + # Edit an API test + # Edit the configuration of a Synthetic API test. + # @param public_id [String] The public ID of the test to get details from. + # @param body [SyntheticsAPITest] New test details to be saved. + # @param [Hash] opts the optional parameters + # @return [SyntheticsAPITest] + def update_api_test(public_id, body, opts = {}) + data, _status_code, _headers = update_api_test_with_http_info(public_id, body, opts) + data + end + + # Edit an API test + # Edit the configuration of a Synthetic API test. + # @param public_id [String] The public ID of the test to get details from. + # @param body [SyntheticsAPITest] New test details to be saved. + # @param [Hash] opts the optional parameters + # @return [Array<(SyntheticsAPITest, Integer, Hash)>] SyntheticsAPITest data, response status code and response headers + def update_api_test_with_http_info(public_id, body, opts = {}) + + if @api_client.config.unstable_operations.has_key?(:update_api_test) + unstable_enabled = @api_client.config.unstable_operations[:update_api_test] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "update_api_test") + else + raise ApiError.new(message: format("Unstable operation '%s' is disabled", "update_api_test")) + end + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsApi.update_api_test ...' + end + # verify the required parameter 'public_id' is set + if @api_client.config.client_side_validation && public_id.nil? + fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsApi.update_api_test" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsApi.update_api_test" + end + # resource path + local_var_path = '/api/v1/synthetics/tests/api/{public_id}'.sub('{' + 'public_id' + '}', CGI.escape(public_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsAPITest' + + # auth_names + auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'appKeyAuth'] + + new_options = opts.merge( + :operation => :"SyntheticsApi.update_api_test", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsApi#update_api_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Edit a browser test + # Edit the configuration of a Synthetic browser test. + # @param public_id [String] The public ID of the test to get details from. + # @param body [SyntheticsBrowserTest] New test details to be saved. + # @param [Hash] opts the optional parameters + # @return [SyntheticsBrowserTest] + def update_browser_test(public_id, body, opts = {}) + data, _status_code, _headers = update_browser_test_with_http_info(public_id, body, opts) + data + end + + # Edit a browser test + # Edit the configuration of a Synthetic browser test. + # @param public_id [String] The public ID of the test to get details from. + # @param body [SyntheticsBrowserTest] New test details to be saved. + # @param [Hash] opts the optional parameters + # @return [Array<(SyntheticsBrowserTest, Integer, Hash)>] SyntheticsBrowserTest data, response status code and response headers + def update_browser_test_with_http_info(public_id, body, opts = {}) + + if @api_client.config.unstable_operations.has_key?(:update_browser_test) + unstable_enabled = @api_client.config.unstable_operations[:update_browser_test] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "update_browser_test") + else + raise ApiError.new(message: format("Unstable operation '%s' is disabled", "update_browser_test")) + end + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsApi.update_browser_test ...' + end + # verify the required parameter 'public_id' is set + if @api_client.config.client_side_validation && public_id.nil? + fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsApi.update_browser_test" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsApi.update_browser_test" + end + # resource path + local_var_path = '/api/v1/synthetics/tests/browser/{public_id}'.sub('{' + 'public_id' + '}', CGI.escape(public_id.to_s)) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsBrowserTest' + + # auth_names + auth_names = opts[:debug_auth_names] || ['apiKeyAuth', 'appKeyAuth'] + + new_options = opts.merge( + :operation => :"SyntheticsApi.update_browser_test", + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsApi#update_browser_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Edit a private location # Edit a Synthetics private location. # @param location_id [String] The ID of the private location. diff --git a/lib/datadog_api_client/v1/models/synthetics_api_test.rb b/lib/datadog_api_client/v1/models/synthetics_api_test.rb new file mode 100644 index 000000000000..a5838181ffd7 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_api_test.rb @@ -0,0 +1,324 @@ +=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://openapi-generator.tech + + 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 details about a Synthetic API test. + class SyntheticsAPITest + attr_accessor :config + + # Array of locations used to run the test. + attr_accessor :locations + + # Notification message associated with the test. + attr_accessor :message + + # The associated monitor ID. + attr_accessor :monitor_id + + # Name of the test. + attr_accessor :name + + attr_accessor :options + + # The public ID for the test. + attr_accessor :public_id + + attr_accessor :status + + attr_accessor :subtype + + # Array of tags attached to the test. + attr_accessor :tags + + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'config' => :'config', + :'locations' => :'locations', + :'message' => :'message', + :'monitor_id' => :'monitor_id', + :'name' => :'name', + :'options' => :'options', + :'public_id' => :'public_id', + :'status' => :'status', + :'subtype' => :'subtype', + :'tags' => :'tags', + :'type' => :'type' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'config' => :'SyntheticsAPITestConfig', + :'locations' => :'Array', + :'message' => :'String', + :'monitor_id' => :'Integer', + :'name' => :'String', + :'options' => :'SyntheticsTestOptions', + :'public_id' => :'String', + :'status' => :'SyntheticsTestPauseStatus', + :'subtype' => :'SyntheticsTestDetailsSubType', + :'tags' => :'Array', + :'type' => :'SyntheticsAPITestType' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsAPITest` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SyntheticsAPITest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'config') + self.config = attributes[:'config'] + end + + if attributes.key?(:'locations') + if (value = attributes[:'locations']).is_a?(Array) + self.locations = value + end + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'monitor_id') + self.monitor_id = attributes[:'monitor_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'options') + self.options = attributes[:'options'] + end + + if attributes.key?(:'public_id') + self.public_id = attributes[:'public_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'subtype') + self.subtype = attributes[:'subtype'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = 'api' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + config == o.config && + locations == o.locations && + message == o.message && + monitor_id == o.monitor_id && + name == o.name && + options == o.options && + public_id == o.public_id && + status == o.status && + subtype == o.subtype && + tags == o.tags && + type == o.type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [config, locations, message, monitor_id, name, options, public_id, status, subtype, tags, type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/synthetics_api_test_config.rb b/lib/datadog_api_client/v1/models/synthetics_api_test_config.rb new file mode 100644 index 000000000000..a0aeceda0fe5 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_api_test_config.rb @@ -0,0 +1,256 @@ +=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://openapi-generator.tech + + 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 + # Configuration object for a Synthetic API test. + class SyntheticsAPITestConfig + # Array of assertions used for the test. + attr_accessor :assertions + + # Array of variables used for the test. + attr_accessor :config_variables + + attr_accessor :request + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'assertions' => :'assertions', + :'config_variables' => :'configVariables', + :'request' => :'request' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'assertions' => :'Array', + :'config_variables' => :'Array', + :'request' => :'SyntheticsTestRequest' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsAPITestConfig` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SyntheticsAPITestConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'assertions') + if (value = attributes[:'assertions']).is_a?(Array) + self.assertions = value + end + end + + if attributes.key?(:'config_variables') + if (value = attributes[:'config_variables']).is_a?(Array) + self.config_variables = value + end + end + + if attributes.key?(:'request') + self.request = attributes[:'request'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @assertions.nil? + invalid_properties.push('invalid value for "assertions", assertions cannot be nil.') + end + + if @request.nil? + invalid_properties.push('invalid value for "request", request cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @assertions.nil? + return false if @request.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assertions == o.assertions && + config_variables == o.config_variables && + request == o.request + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [assertions, config_variables, request].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/synthetics_api_test_type.rb b/lib/datadog_api_client/v1/models/synthetics_api_test_type.rb new file mode 100644 index 000000000000..b2a37b3f0c7a --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_api_test_type.rb @@ -0,0 +1,39 @@ +=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://openapi-generator.tech + + 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 + class SyntheticsAPITestType + API = "api".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SyntheticsAPITestType.constants.select { |c| SyntheticsAPITestType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SyntheticsAPITestType" if constantValues.empty? + value + end + end +end diff --git a/lib/datadog_api_client/v1/models/synthetics_browser_test.rb b/lib/datadog_api_client/v1/models/synthetics_browser_test.rb new file mode 100644 index 000000000000..ee04c8c8eb45 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_browser_test.rb @@ -0,0 +1,327 @@ +=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://openapi-generator.tech + + 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 details about a Synthetic browser test. + class SyntheticsBrowserTest + attr_accessor :config + + # Array of locations used to run the test. + attr_accessor :locations + + # Notification message associated with the test. + attr_accessor :message + + # The associated monitor ID. + attr_accessor :monitor_id + + # Name of the test. + attr_accessor :name + + attr_accessor :options + + # The public ID of the test. + attr_accessor :public_id + + attr_accessor :status + + # The steps of the test. + attr_accessor :steps + + # Array of tags attached to the test. + attr_accessor :tags + + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'config' => :'config', + :'locations' => :'locations', + :'message' => :'message', + :'monitor_id' => :'monitor_id', + :'name' => :'name', + :'options' => :'options', + :'public_id' => :'public_id', + :'status' => :'status', + :'steps' => :'steps', + :'tags' => :'tags', + :'type' => :'type' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'config' => :'SyntheticsBrowserTestConfig', + :'locations' => :'Array', + :'message' => :'String', + :'monitor_id' => :'Integer', + :'name' => :'String', + :'options' => :'SyntheticsTestOptions', + :'public_id' => :'String', + :'status' => :'SyntheticsTestPauseStatus', + :'steps' => :'Array', + :'tags' => :'Array', + :'type' => :'SyntheticsBrowserTestType' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsBrowserTest` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SyntheticsBrowserTest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'config') + self.config = attributes[:'config'] + end + + if attributes.key?(:'locations') + if (value = attributes[:'locations']).is_a?(Array) + self.locations = value + end + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'monitor_id') + self.monitor_id = attributes[:'monitor_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'options') + self.options = attributes[:'options'] + end + + if attributes.key?(:'public_id') + self.public_id = attributes[:'public_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'steps') + if (value = attributes[:'steps']).is_a?(Array) + self.steps = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + else + self.type = 'browser' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + config == o.config && + locations == o.locations && + message == o.message && + monitor_id == o.monitor_id && + name == o.name && + options == o.options && + public_id == o.public_id && + status == o.status && + steps == o.steps && + tags == o.tags && + type == o.type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [config, locations, message, monitor_id, name, options, public_id, status, steps, tags, type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/synthetics_browser_test_config.rb b/lib/datadog_api_client/v1/models/synthetics_browser_test_config.rb new file mode 100644 index 000000000000..8adfa461dc94 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_browser_test_config.rb @@ -0,0 +1,256 @@ +=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://openapi-generator.tech + + 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 + # Configuration object for a Synthetic browser test. + class SyntheticsBrowserTestConfig + # Array of assertions used for the test. + attr_accessor :assertions + + attr_accessor :request + + # Array of variables used for the test steps. + attr_accessor :variables + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'assertions' => :'assertions', + :'request' => :'request', + :'variables' => :'variables' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'assertions' => :'Array', + :'request' => :'SyntheticsTestRequest', + :'variables' => :'Array' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::SyntheticsBrowserTestConfig` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::SyntheticsBrowserTestConfig`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'assertions') + if (value = attributes[:'assertions']).is_a?(Array) + self.assertions = value + end + end + + if attributes.key?(:'request') + self.request = attributes[:'request'] + end + + if attributes.key?(:'variables') + if (value = attributes[:'variables']).is_a?(Array) + self.variables = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @assertions.nil? + invalid_properties.push('invalid value for "assertions", assertions cannot be nil.') + end + + if @request.nil? + invalid_properties.push('invalid value for "request", request cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @assertions.nil? + return false if @request.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assertions == o.assertions && + request == o.request && + variables == o.variables + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [assertions, request, variables].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/synthetics_browser_test_type.rb b/lib/datadog_api_client/v1/models/synthetics_browser_test_type.rb new file mode 100644 index 000000000000..f20bc6f76bb9 --- /dev/null +++ b/lib/datadog_api_client/v1/models/synthetics_browser_test_type.rb @@ -0,0 +1,39 @@ +=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://openapi-generator.tech + + 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 + class SyntheticsBrowserTestType + BROWSER = "browser".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = SyntheticsBrowserTestType.constants.select { |c| SyntheticsBrowserTestType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #SyntheticsBrowserTestType" if constantValues.empty? + value + end + end +end diff --git a/spec/v1/models/synthetics_api_test_config_spec.rb b/spec/v1/models/synthetics_api_test_config_spec.rb new file mode 100644 index 000000000000..cbfca5001b6b --- /dev/null +++ b/spec/v1/models/synthetics_api_test_config_spec.rb @@ -0,0 +1,49 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::SyntheticsAPITestConfig +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::SyntheticsAPITestConfig do + let(:instance) { DatadogAPIClient::V1::SyntheticsAPITestConfig.new } + + describe 'test an instance of SyntheticsAPITestConfig' do + it 'should create an instance of SyntheticsAPITestConfig' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::SyntheticsAPITestConfig) + end + end + describe 'test attribute "assertions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "config_variables"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "request"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/synthetics_api_test_spec.rb b/spec/v1/models/synthetics_api_test_spec.rb new file mode 100644 index 000000000000..6f31564c7bee --- /dev/null +++ b/spec/v1/models/synthetics_api_test_spec.rb @@ -0,0 +1,97 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::SyntheticsAPITest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::SyntheticsAPITest do + let(:instance) { DatadogAPIClient::V1::SyntheticsAPITest.new } + + describe 'test an instance of SyntheticsAPITest' do + it 'should create an instance of SyntheticsAPITest' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::SyntheticsAPITest) + end + end + describe 'test attribute "config"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "locations"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "monitor_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "options"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "public_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "subtype"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tags"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/synthetics_api_test_type_spec.rb b/spec/v1/models/synthetics_api_test_type_spec.rb new file mode 100644 index 000000000000..dd47f4740176 --- /dev/null +++ b/spec/v1/models/synthetics_api_test_type_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::SyntheticsAPITestType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::SyntheticsAPITestType do + let(:instance) { DatadogAPIClient::V1::SyntheticsAPITestType.new } + + describe 'test an instance of SyntheticsAPITestType' do + it 'should create an instance of SyntheticsAPITestType' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::SyntheticsAPITestType) + end + end +end diff --git a/spec/v1/models/synthetics_browser_test_config_spec.rb b/spec/v1/models/synthetics_browser_test_config_spec.rb new file mode 100644 index 000000000000..0d0ff9d7806f --- /dev/null +++ b/spec/v1/models/synthetics_browser_test_config_spec.rb @@ -0,0 +1,49 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::SyntheticsBrowserTestConfig +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::SyntheticsBrowserTestConfig do + let(:instance) { DatadogAPIClient::V1::SyntheticsBrowserTestConfig.new } + + describe 'test an instance of SyntheticsBrowserTestConfig' do + it 'should create an instance of SyntheticsBrowserTestConfig' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::SyntheticsBrowserTestConfig) + end + end + describe 'test attribute "assertions"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "request"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "variables"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/synthetics_browser_test_spec.rb b/spec/v1/models/synthetics_browser_test_spec.rb new file mode 100644 index 000000000000..890844361ce7 --- /dev/null +++ b/spec/v1/models/synthetics_browser_test_spec.rb @@ -0,0 +1,97 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::SyntheticsBrowserTest +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::SyntheticsBrowserTest do + let(:instance) { DatadogAPIClient::V1::SyntheticsBrowserTest.new } + + describe 'test an instance of SyntheticsBrowserTest' do + it 'should create an instance of SyntheticsBrowserTest' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::SyntheticsBrowserTest) + end + end + describe 'test attribute "config"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "locations"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "monitor_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "options"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "public_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "steps"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tags"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/synthetics_browser_test_type_spec.rb b/spec/v1/models/synthetics_browser_test_type_spec.rb new file mode 100644 index 000000000000..ac505950b2d9 --- /dev/null +++ b/spec/v1/models/synthetics_browser_test_type_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::SyntheticsBrowserTestType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::SyntheticsBrowserTestType do + let(:instance) { DatadogAPIClient::V1::SyntheticsBrowserTestType.new } + + describe 'test an instance of SyntheticsBrowserTestType' do + it 'should create an instance of SyntheticsBrowserTestType' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::SyntheticsBrowserTestType) + end + end +end