From d39288443a6d7a798c302c0d2a9e9cb1a4689d9a Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 31 Aug 2022 12:51:55 -0400 Subject: [PATCH 01/30] Bump version (#821) Co-authored-by: ci.datadog-api-spec --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 54d6e8649f65..0cb755af56df 100644 --- a/package.json +++ b/package.json @@ -111,5 +111,5 @@ "engines": { "node": ">=12.0.0" }, - "version": "1.3.0" + "version": "1.3.1-beta.0" } From a08d5c49f9e9dc3c3e87d81480091edec5f5b08f Mon Sep 17 00:00:00 2001 From: Kevin Zou <17015060+nkzou@users.noreply.github.com> Date: Thu, 1 Sep 2022 08:16:52 -0400 Subject: [PATCH 02/30] Specify python version in Github runner (#822) * add python setup and specific python version in test workflow, unpin poetry version * switch to global pip instead of venv pip * try without cache * update poetry dependency to use python 3.10+ --- .generator/pyproject.toml | 2 +- .github/workflows/test.yml | 3 +++ .pre-commit-config.yaml | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.generator/pyproject.toml b/.generator/pyproject.toml index 5b334c7e77d7..3b5061551940 100644 --- a/.generator/pyproject.toml +++ b/.generator/pyproject.toml @@ -6,7 +6,7 @@ authors = ["Datadog "] license = "Apache-2.0" [tool.poetry.dependencies] -python = "^3.9" +python = "^3.10" click = "8.0.1" PyYAML = "6.0" jsonref = "0.2" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9dda5e20a27a..f133857d3286 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,6 +35,9 @@ jobs: fetch-depth: 0 ref: ${{ github.event.pull_request.head.sha }} token: ${{ steps.get_token.outputs.token }} + - uses: actions/setup-python@v4 + with: + python-version: '3.10' # Fetch a fork of the repo - uses: actions/checkout@v3 if: github.event.pull_request.head.repo.full_name != github.repository diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1588a6a018a9..f574d2134cb2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: stages: [manual] pass_filenames: false additional_dependencies: - - "poetry==1.1.15" + - "poetry" - id: examples name: examples language: python @@ -36,4 +36,4 @@ repos: stages: [manual] pass_filenames: false additional_dependencies: - - "poetry==1.1.15" + - "poetry" From 1de327a8777e927d7f8953ac8b43b1682301cc66 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 21:17:42 +0000 Subject: [PATCH 03/30] Regenerate client from commit db2c39ca of spec repo (#820) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 ++++---- .../recording.har | 2 +- features/v1/synthetics.feature | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 17bfb70ef173..e07681cb5c97 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-08-30 13:34:36.964978", - "spec_repo_commit": "1d2b67d9" + "regenerated": "2022-09-01 20:59:41.473168", + "spec_repo_commit": "db2c39ca" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-08-30 13:34:36.982005", - "spec_repo_commit": "1d2b67d9" + "regenerated": "2022-09-01 20:59:41.485451", + "spec_repo_commit": "db2c39ca" } } } \ No newline at end of file diff --git a/cassettes/v1/Synthetics_2658572017/Get-an-API-test-result-returns-result-with-failure-object_3671979984/recording.har b/cassettes/v1/Synthetics_2658572017/Get-an-API-test-result-returns-result-with-failure-object_3671979984/recording.har index 99d66a63ce74..996e7373cfca 100644 --- a/cassettes/v1/Synthetics_2658572017/Get-an-API-test-result-returns-result-with-failure-object_3671979984/recording.har +++ b/cassettes/v1/Synthetics_2658572017/Get-an-API-test-result-returns-result-with-failure-object_3671979984/recording.har @@ -138,7 +138,7 @@ "content": { "mimeType": "application/json", "size": 802, - "text": "{\"status\":1,\"run_type\":3,\"check_time\":1644495859933,\"check_version\":1,\"result\":{\"subtype\":\"http\",\"eventType\":\"finished\",\"timings\":{\"total\":45.8,\"dns\":14.5},\"failure\":{\"message\":\"Error during DNS resolution (ENOTFOUND).\",\"code\":\"DNS\"},\"mainDC\":\"us1.prod\",\"passed\":false,\"error\":\"Error during DNS resolution (ENOTFOUND).\",\"runType\":3,\"enrichment\":{}},\"probe_dc\":\"aws:eu-west-3\",\"result_id\":\"990211588540730529\",\"check\":{\"type\":\"api\",\"config\":{\"request\":{\"url\":\"https://app.datadfoghq.com\",\"method\":\"GET\"},\"assertions\":[{\"operator\":\"lessThan\",\"type\":\"responseTime\",\"target\":1000}]},\"options\":{\"monitor_options\":{\"notify_audit\":false,\"locked\":false,\"include_tags\":true,\"new_host_delay\":300,\"notify_no_data\":false,\"renotify_interval\":0},\"tick_every\":86400,\"min_failure_duration\":0,\"min_location_failed\":1}}}" + "text": "{\"status\":1,\"run_type\":3,\"check_time\":1644495859933,\"check_version\":1,\"result\":{\"subtype\":\"http\",\"eventType\":\"finished\",\"timings\":{\"total\":45.8,\"dns\":14.5},\"failure\":{\"message\":\"Error during DNS resolution of hostname app.datadfoghq.com (ENOTFOUND).\",\"code\":\"DNS\"},\"mainDC\":\"us1.prod\",\"passed\":false,\"error\":\"Error during DNS resolution (ENOTFOUND).\",\"runType\":3,\"enrichment\":{}},\"probe_dc\":\"aws:eu-west-3\",\"result_id\":\"990211588540730529\",\"check\":{\"type\":\"api\",\"config\":{\"request\":{\"url\":\"https://app.datadfoghq.com\",\"method\":\"GET\"},\"assertions\":[{\"operator\":\"lessThan\",\"type\":\"responseTime\",\"target\":1000}]},\"options\":{\"monitor_options\":{\"notify_audit\":false,\"locked\":false,\"include_tags\":true,\"new_host_delay\":300,\"notify_no_data\":false,\"renotify_interval\":0},\"tick_every\":86400,\"min_failure_duration\":0,\"min_location_failed\":1}}}" }, "cookies": [], "headers": [ diff --git a/features/v1/synthetics.feature b/features/v1/synthetics.feature index 330f714b9f88..0d88a13d6d9e 100644 --- a/features/v1/synthetics.feature +++ b/features/v1/synthetics.feature @@ -449,7 +449,7 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK And the response "result.failure.code" is equal to "DNS" - And the response "result.failure.message" is equal to "Error during DNS resolution (ENOTFOUND)." + And the response "result.failure.message" is equal to "Error during DNS resolution of hostname app.datadfoghq.com (ENOTFOUND)." @generated @skip @team:DataDog/synthetics-app Scenario: Get an API test returns "- Synthetic Monitoring is not activated for the user" response From c7f9990d67b6be4493be158cccce3e6318163888 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 2 Sep 2022 13:14:39 +0000 Subject: [PATCH 04/30] Regenerate client from commit 3aa1b866 of spec repo (#785) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 136 ++++++++++++- .../frozen.json | 1 + .../recording.har | 64 ++++++ .../frozen.json | 1 + .../recording.har | 64 ++++++ .../frozen.json | 1 + .../recording.har | 64 ++++++ .../frozen.json | 1 + .../recording.har | 64 ++++++ .../frozen.json | 1 + .../recording.har | 110 +++++++++++ .../metrics/ListActiveMetricConfigurations.ts | 21 ++ examples/v2/metrics/ListTagConfigurations.ts | 2 +- ....ts => ListTagConfigurations_265033704.ts} | 5 +- ...ts => ListTagConfigurations_2739018321.ts} | 2 +- features/v2/metrics.feature | 88 ++++++--- features/v2/undo.json | 6 + .../datadog-api-client-v2/apis/MetricsApi.ts | 187 +++++++++++++++++- packages/datadog-api-client-v2/index.ts | 5 + .../models/MetricActiveConfigurationType.ts | 10 + .../MetricSuggestedTagsAndAggregations.ts | 59 ++++++ ...ricSuggestedTagsAndAggregationsResponse.ts | 42 ++++ .../models/MetricSuggestedTagsAttributes.ts | 50 +++++ .../models/ObjectSerializer.ts | 8 + 25 files changed, 944 insertions(+), 56 deletions(-) create mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/frozen.json create mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/recording.har create mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/frozen.json create mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/recording.har create mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-a-tag-filter-returns-Success-response_2147147172/frozen.json create mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-a-tag-filter-returns-Success-response_2147147172/recording.har create mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-configured-filter-returns-Success-response_2949073099/frozen.json create mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-configured-filter-returns-Success-response_2949073099/recording.har create mode 100644 cassettes/v2/Metrics_2046978582/List-active-tags-and-aggregations-returns-Success-response_688693587/frozen.json create mode 100644 cassettes/v2/Metrics_2046978582/List-active-tags-and-aggregations-returns-Success-response_688693587/recording.har create mode 100644 examples/v2/metrics/ListActiveMetricConfigurations.ts rename examples/v2/metrics/{ListTagConfigurations_1799362914.ts => ListTagConfigurations_265033704.ts} (75%) rename examples/v2/metrics/{ListTagConfigurations_103226315.ts => ListTagConfigurations_2739018321.ts} (87%) create mode 100644 packages/datadog-api-client-v2/models/MetricActiveConfigurationType.ts create mode 100644 packages/datadog-api-client-v2/models/MetricSuggestedTagsAndAggregations.ts create mode 100644 packages/datadog-api-client-v2/models/MetricSuggestedTagsAndAggregationsResponse.ts create mode 100644 packages/datadog-api-client-v2/models/MetricSuggestedTagsAttributes.ts diff --git a/.apigentools-info b/.apigentools-info index e07681cb5c97..02f5923ec903 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-01 20:59:41.473168", - "spec_repo_commit": "db2c39ca" + "regenerated": "2022-09-02 12:49:58.211262", + "spec_repo_commit": "3aa1b866" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-01 20:59:41.485451", - "spec_repo_commit": "db2c39ca" + "regenerated": "2022-09-02 12:49:58.223954", + "spec_repo_commit": "3aa1b866" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a80513594802..ef1c74ffe488 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4156,6 +4156,15 @@ components: type: $ref: '#/components/schemas/MetricType' type: object + MetricActiveConfigurationType: + default: actively_queried_configurations + description: The metric actively queried configuration resource type. + enum: + - actively_queried_configurations + example: actively_queried_configurations + type: string + x-enum-varnames: + - ACTIVELY_QUERIED_CONFIGURATIONS MetricAllTags: description: Object for a single metric's indexed tags. properties: @@ -4681,6 +4690,50 @@ components: - metric - points type: object + MetricSuggestedAggregations: + description: List of aggregation combinations that have been actively queried. + example: + - space: sum + time: sum + - space: sum + time: count + items: + $ref: '#/components/schemas/MetricCustomAggregation' + type: array + MetricSuggestedTagsAndAggregations: + description: Object for a single metric's actively queried tags and aggregations. + properties: + attributes: + $ref: '#/components/schemas/MetricSuggestedTagsAttributes' + id: + $ref: '#/components/schemas/MetricName' + type: + $ref: '#/components/schemas/MetricActiveConfigurationType' + type: object + MetricSuggestedTagsAndAggregationsResponse: + description: Response object that includes a single metric's actively queried + tags and aggregations. + properties: + data: + $ref: '#/components/schemas/MetricSuggestedTagsAndAggregations' + readOnly: true + type: object + MetricSuggestedTagsAttributes: + description: Object containing the definition of a metric's actively queried + tags and aggregations. + properties: + active_aggregations: + $ref: '#/components/schemas/MetricSuggestedAggregations' + active_tags: + description: List of tag keys that have been actively queried. + example: + - app + - datacenter + items: + description: Actively queried tag keys. + type: string + type: array + type: object MetricTagConfiguration: description: Object for a single metric tag configuration. example: @@ -10615,12 +10668,10 @@ paths: resultsPath: data /api/v2/metrics: get: - description: 'Returns all configured count/gauge/rate/distribution metric names - - (with additional filters if specified).' + description: Returns all metrics (matching additional filters if specified). operationId: ListTagConfigurations parameters: - - description: Filter metrics that have configured tags. + - description: Filter custom metrics that have configured tags. example: true in: query name: filter[configured] @@ -10635,7 +10686,7 @@ paths: schema: description: Tag keys to filter by. type: string - - description: Filter tag configurations by metric type. + - description: Filter metrics by metric type. in: query name: filter[metric_type] required: false @@ -10650,10 +10701,21 @@ paths: required: false schema: type: boolean + - description: 'Filter custom metrics that have or have not been queried in + the specified window[seconds]. + + If no window is provided or the window is less than 2 hours, a default of + 2 hours will be applied.' + example: true + in: query + name: filter[queried] + required: false + schema: + type: boolean - description: 'Filter metrics that have been submitted with the given tags. Supports boolean and wildcard expressions. - Cannot be combined with other filters.' + Can only be combined with the filter[queried] filter.' example: env IN (staging,test) AND service:web in: query name: filter[tags] @@ -10661,9 +10723,9 @@ paths: schema: type: string - description: 'The number of seconds of look back (from now) to apply to a - filter[tag] query. + filter[tag] or filter[queried] query. - Defaults value is 3600 (1 hour), maximum value is 172,800 (2 days).' + Defaults value is 3600 (1 hour), maximum value is 1,209,600 (2 weeks).' example: 3600 in: query name: window[seconds] @@ -10701,7 +10763,7 @@ paths: appKeyAuth: [] - AuthZ: - metrics_read - summary: List tag configurations + summary: Get a list of metrics tags: - Metrics /api/v2/metrics/config/bulk-tags: @@ -10817,6 +10879,62 @@ paths: tags: - Metrics x-codegen-request-body-name: body + /api/v2/metrics/{metric_name}/active-configurations: + get: + description: List tags and aggregations that are actively queried on dashboards + and monitors for a given metric name. + operationId: ListActiveMetricConfigurations + parameters: + - $ref: '#/components/parameters/MetricName' + - description: 'The number of seconds of look back (from now). + + Default value is 604,800 (1 week), minimum value is 7200 (2 hours), maximum + value is 2,630,000 (1 month).' + example: 7200 + in: query + name: window[seconds] + required: false + schema: + format: int64 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MetricSuggestedTagsAndAggregationsResponse' + description: Success + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not Found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too Many Requests + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: List active tags and aggregations + tags: + - Metrics /api/v2/metrics/{metric_name}/all-tags: get: description: View indexed tag key-value pairs for a given metric name. diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/frozen.json b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/frozen.json new file mode 100644 index 000000000000..daa985758474 --- /dev/null +++ b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/frozen.json @@ -0,0 +1 @@ +"2022-08-05T07:10:54.386Z" diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/recording.har b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/recording.har new file mode 100644 index 000000000000..8e5806e5cfc8 --- /dev/null +++ b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/recording.har @@ -0,0 +1,64 @@ +{ + "log": { + "_recordingName": "Metrics/Get a list of Metrics with a tag filter returns \"Success\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "58cad22be78c362f8c820fd9232233aa", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 594, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "filter", + "value": { + "tags": "TestGetalistofMetricswithatagfilterreturnsSuccessresponse1659683454" + } + } + ], + "url": "https://api.datadoghq.com/api/v2/metrics?filter%5Btags%5D=TestGetalistofMetricswithatagfilterreturnsSuccessresponse1659683454" + }, + "response": { + "bodySize": 12, + "content": { + "mimeType": "application/json", + "size": 12, + "text": "{\"data\":[]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 599, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-08-05T07:10:54.408Z", + "time": 609 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/frozen.json b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/frozen.json new file mode 100644 index 000000000000..260f4f64522a --- /dev/null +++ b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/frozen.json @@ -0,0 +1 @@ +"2022-08-05T07:10:55.036Z" diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/recording.har b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/recording.har new file mode 100644 index 000000000000..6d0712fd82ed --- /dev/null +++ b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/recording.har @@ -0,0 +1,64 @@ +{ + "log": { + "_recordingName": "Metrics/Get a list of Metrics with configured filter returns \"Success\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "6a6c3737116332b63162f7d3bcb05a06", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 536, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "filter", + "value": { + "configured": "true" + } + } + ], + "url": "https://api.datadoghq.com/api/v2/metrics?filter%5Bconfigured%5D=true" + }, + "response": { + "bodySize": 61346, + "content": { + "mimeType": "application/json", + "size": 61346, + "text": "{\"data\":[{\"type\":\"manage_tags\",\"id\":\"test.metric.1\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"created_at\":\"2022-03-24T18:23:55.957002+00:00\",\"modified_at\":\"2022-03-28T14:34:32.618807+00:00\",\"metric_type\":\"gauge\",\"aggregations\":[{\"space\":\"avg\",\"time\":\"avg\"}]}},{\"type\":\"manage_tags\",\"id\":\"foo\",\"attributes\":{\"tags\":[\"datacenter\",\"sport\"],\"created_at\":\"2021-10-27T12:35:56.242671+00:00\",\"modified_at\":\"2021-10-27T12:41:22.413540+00:00\",\"metric_type\":\"count\",\"aggregations\":[{\"space\":\"sum\",\"time\":\"sum\"}]}},{\"type\":\"manage_tags\",\"id\":\"ExampleListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1653177320\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"ExampleListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1653177320\"],\"created_at\":\"2022-05-21T23:55:28.435000+00:00\",\"modified_at\":\"2022-05-21T23:55:28.435000+00:00\",\"metric_type\":\"gauge\",\"aggregations\":[{\"space\":\"avg\",\"time\":\"avg\"}]}},{\"type\":\"manage_tags\",\"id\":\"javaCreateatagconfigu1617241053\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:34.078032+00:00\",\"modified_at\":\"2021-05-07T09:02:37.581544+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1616498653\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:13.435931+00:00\",\"modified_at\":\"2021-03-23T11:24:13.435931+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagsbymetricnamereturnsSuccessresponse1618241083\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListtagsbymetricnamereturnsSuccessresponse1618241083\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T15:24:43.937851+00:00\",\"modified_at\":\"2021-04-12T15:24:43.937851+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioCreateaTagConfigurationreturnsCreatedresponse462771613138431\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.059033+00:00\",\"modified_at\":\"2021-02-12T14:00:32.059033+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioDeleteaTagConfigurationreturnsNoContentresponse462771613138432\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioDeleteaTagConfigurationreturnsNoContentresponse462771613138432\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.286794+00:00\",\"modified_at\":\"2021-02-12T14:00:32.286794+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse462771613138432\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse462771613138432\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.668585+00:00\",\"modified_at\":\"2021-02-12T14:00:32.668585+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListTagConfigurationsreturnsSuccessresponse462771613138432\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListTagConfigurationsreturnsSuccessresponse462771613138432\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.953685+00:00\",\"modified_at\":\"2021-02-12T14:00:32.953685+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateaTagConfigurationreturnsOKresponse462771613138437\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateaTagConfigurationreturnsOKresponse462771613138437\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:37.707422+00:00\",\"modified_at\":\"2021-02-12T14:00:37.707422+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1613308647656458\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-14T13:17:28.200159+00:00\",\"modified_at\":\"2021-02-14T13:17:28.200159+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaDeleteaTagConfigu1613601517\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaDeleteaTagConfigu1613601517\"],\"include_percentiles\":false,\"created_at\":\"2021-02-17T22:38:38.226434+00:00\",\"modified_at\":\"2021-02-17T22:38:38.226434+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613674911438\",\"attributes\":{\"tags\":[\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613674911438\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:51.701561+00:00\",\"modified_at\":\"2021-02-18T19:01:51.701561+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateaTagConfigurationreturnsCreatedresponse1613674910068\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:50.346751+00:00\",\"modified_at\":\"2021-02-18T19:01:50.346751+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationsreturnsSuccessresponse1613674912224\",\"attributes\":{\"tags\":[\"TypescriptListTagConfigurationsreturnsSuccessresponse1613674912224\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:52.489744+00:00\",\"modified_at\":\"2021-02-18T19:01:52.489744+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateaTagConfigurationreturnsOKresponse1613674918621\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:58.909298+00:00\",\"modified_at\":\"2021-02-18T19:01:59.239616+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateaTagConfigurationreturnsCreatedresponse1613675388888\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:49.157042+00:00\",\"modified_at\":\"2021-02-18T19:09:49.157042+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateaTagConfigurationreturnsOKresponse1613675398177\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:58.429942+00:00\",\"modified_at\":\"2021-02-18T19:09:58.778902+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationsreturnsSuccessresponse1613675391059\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListTagConfigurationsreturnsSuccessresponse1613675391059\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:51.329650+00:00\",\"modified_at\":\"2021-02-18T19:09:51.329650+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613675390193\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613675390193\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:50.468784+00:00\",\"modified_at\":\"2021-02-18T19:09:50.468784+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteaTagConfigurationreturnsNoContentresponse1613676227224\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptDeleteaTagConfigurationreturnsNoContentresponse1613676227224\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:23:47.510239+00:00\",\"modified_at\":\"2021-02-18T19:23:47.510239+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1613983335\",\"attributes\":{\"tags\":[\"javaUpdateaTagConfigu1613983335\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-22T08:42:15.339339+00:00\",\"modified_at\":\"2021-02-22T08:42:15.339339+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1613983337447904\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1613983337447904\"],\"include_percentiles\":false,\"created_at\":\"2021-02-22T08:42:17.877627+00:00\",\"modified_at\":\"2021-02-22T08:42:17.877627+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateaTagConfigurationreturnsCreatedresponse1613983377189\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-22T08:42:57.496771+00:00\",\"modified_at\":\"2021-02-22T08:42:57.496771+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse489431614557161\",\"attributes\":{\"tags\":[\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse489431614557161\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-01T00:06:01.798862+00:00\",\"modified_at\":\"2021-03-01T00:06:01.798862+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1614290498\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateaTagConfigu1614290498\"],\"include_percentiles\":false,\"created_at\":\"2021-02-25T22:01:38.735081+00:00\",\"modified_at\":\"2021-02-25T22:01:38.735081+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1614648774\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateaTagConfigu1614648774\"],\"include_percentiles\":false,\"created_at\":\"2021-03-02T01:32:55.019781+00:00\",\"modified_at\":\"2021-03-02T01:32:55.019781+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1612987674596336\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1612987674596336\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:54.979797+00:00\",\"modified_at\":\"2021-03-03T22:28:32.386290+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1612987679233002\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:59.516348+00:00\",\"modified_at\":\"2021-03-03T20:42:09.521631+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagconfigurationsreturnssuccessresponse1612987675260358\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagconfigurationsreturnssuccessresponse1612987675260358\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:55.559669+00:00\",\"modified_at\":\"2021-03-03T20:45:46.030871+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateaTagConfigurationreturnsOKresponse1614821029942\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptUpdateaTagConfigurationreturnsOKresponse1614821029942\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T01:23:50.307273+00:00\",\"modified_at\":\"2021-03-04T01:23:50.307273+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1614632066664577\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1614632066664577\"],\"include_percentiles\":false,\"created_at\":\"2021-03-01T20:54:26.950587+00:00\",\"modified_at\":\"2021-03-03T19:53:57.601421+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1612987678724128\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1612987678724128\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:59.011905+00:00\",\"modified_at\":\"2021-03-03T19:54:03.012021+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1614907949\",\"attributes\":{\"tags\":[\"javaUpdateaTagConfigu1614907949\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:29.891018+00:00\",\"modified_at\":\"2021-03-05T01:32:29.891018+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListTagConfigurati1614907942\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListTagConfigurati1614907942\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:22.257630+00:00\",\"modified_at\":\"2021-03-05T01:32:22.779595+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaCreateaTagConfigu1614907941\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:21.472249+00:00\",\"modified_at\":\"2021-03-05T01:32:21.472249+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaDeleteaTagConfigu1614907941\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaDeleteaTagConfigu1614907941\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:21.840312+00:00\",\"modified_at\":\"2021-03-05T01:32:21.840312+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1614877824877072\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1614877824877072\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T17:10:25.408162+00:00\",\"modified_at\":\"2021-03-04T18:03:35.564866+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse161487782309652\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse161487782309652\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T17:10:23.841708+00:00\",\"modified_at\":\"2021-03-04T18:03:25.853564+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1614878558721298\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1614878558721298\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T17:22:39.122261+00:00\",\"modified_at\":\"2021-03-04T18:03:33.352006+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1612987679647768\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1612987679647768\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:59.946457+00:00\",\"modified_at\":\"2021-03-04T09:39:37.370474+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1614962335\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1614962335\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T16:38:55.946186+00:00\",\"modified_at\":\"2021-03-05T16:38:55.946186+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateatagconfigu1614962336\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateatagconfigu1614962336\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T16:38:56.440191+00:00\",\"modified_at\":\"2021-03-05T16:38:56.440191+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1614984109\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1614984109\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T22:41:50.029868+00:00\",\"modified_at\":\"2021-03-05T22:41:50.029868+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse505431615205163\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse505431615205163\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T12:06:03.965736+00:00\",\"modified_at\":\"2021-03-08T12:06:03.965736+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaCreateatagconfigu1615195320\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:00.581891+00:00\",\"modified_at\":\"2021-03-08T09:22:00.581891+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListdistinctmetric1615195322\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListdistinctmetric1615195322\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:02.640568+00:00\",\"modified_at\":\"2021-03-08T09:22:02.640568+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaDeleteatagconfigu1615195321\",\"attributes\":{\"tags\":[\"javaDeleteatagconfigu1615195321\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:01.374349+00:00\",\"modified_at\":\"2021-03-08T09:22:01.374349+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1615195323\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagconfigurati1615195323\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:03.733804+00:00\",\"modified_at\":\"2021-03-08T09:22:03.733804+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1615195324\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagconfigurati1615195324\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:04.847552+00:00\",\"modified_at\":\"2021-03-08T09:22:04.847552+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1615195329\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1615195329\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:10.192146+00:00\",\"modified_at\":\"2021-03-08T09:22:10.192146+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateatagconfigu1615195330\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateatagconfigu1615195330\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:11.353873+00:00\",\"modified_at\":\"2021-03-08T09:22:11.353873+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615241008139\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615241008139\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T22:03:28.250137+00:00\",\"modified_at\":\"2021-03-08T22:03:28.250137+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagconfigurationsreturnsSuccessresponse1618243860\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListtagconfigurationsreturnsSuccessresponse1618243860\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:11:00.453385+00:00\",\"modified_at\":\"2021-04-12T16:11:00.453385+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse507811615269834\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse507811615269834\"],\"include_percentiles\":false,\"created_at\":\"2021-03-09T06:03:55.035011+00:00\",\"modified_at\":\"2021-03-09T06:03:55.035011+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1615289582\",\"attributes\":{\"tags\":[\"javaListtagconfigurati1615289582\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-09T11:33:02.415435+00:00\",\"modified_at\":\"2021-03-09T11:33:02.415435+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse511141615397094\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse511141615397094\"],\"include_percentiles\":false,\"created_at\":\"2021-03-10T17:24:54.232169+00:00\",\"modified_at\":\"2021-03-10T17:24:54.232169+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse511141615397093\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse511141615397093\"],\"include_percentiles\":false,\"created_at\":\"2021-03-10T17:24:53.773142+00:00\",\"modified_at\":\"2021-03-10T17:24:53.773142+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagsbymetricnamereturnsSuccessresponse1615600096\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagsbymetricnamereturnsSuccessresponse1615600096\"],\"include_percentiles\":false,\"created_at\":\"2021-03-13T01:48:16.706740+00:00\",\"modified_at\":\"2021-03-13T01:48:16.706740+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyUpdateatagconfigurationreturnsOKresponse1615600097\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyUpdateatagconfigurationreturnsOKresponse1615600097\"],\"include_percentiles\":false,\"created_at\":\"2021-03-13T01:48:17.311123+00:00\",\"modified_at\":\"2021-03-13T01:48:17.311123+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615641825358\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615641825358\"],\"include_percentiles\":false,\"created_at\":\"2021-03-13T13:23:45.714258+00:00\",\"modified_at\":\"2021-03-13T13:23:45.714258+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1615728221108\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1615728221108\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-14T13:23:41.436621+00:00\",\"modified_at\":\"2021-03-14T13:23:41.436621+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615728219671\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615728219671\"],\"include_percentiles\":false,\"created_at\":\"2021-03-14T13:23:40.016425+00:00\",\"modified_at\":\"2021-03-14T13:23:40.016425+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615901000076\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615901000076\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:20.213657+00:00\",\"modified_at\":\"2021-03-16T13:23:20.213657+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615900999594\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615900999594\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:19.703100+00:00\",\"modified_at\":\"2021-03-16T13:23:19.703100+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1615901001052\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1615901001052\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:21.193223+00:00\",\"modified_at\":\"2021-03-16T13:23:21.193223+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1615900999263\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:19.393024+00:00\",\"modified_at\":\"2021-03-16T13:23:19.393024+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1615901000614\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1615901000614\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:20.718208+00:00\",\"modified_at\":\"2021-03-16T13:23:20.718208+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615901006889\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615901006889\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:27.006017+00:00\",\"modified_at\":\"2021-03-16T13:23:27.006017+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1615901007411\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1615901007411\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:27.541142+00:00\",\"modified_at\":\"2021-03-16T13:23:27.541142+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse519741615886584\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse519741615886584\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:04.506963+00:00\",\"modified_at\":\"2021-03-16T09:23:04.506963+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse519741615886584\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse519741615886584\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:04.173080+00:00\",\"modified_at\":\"2021-03-16T09:23:04.173080+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse519741615886585\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse519741615886585\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:05.166846+00:00\",\"modified_at\":\"2021-03-16T09:23:05.166846+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioCreateatagconfigurationreturnsCreatedresponse519741615886583\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:03.873546+00:00\",\"modified_at\":\"2021-03-16T09:23:03.873546+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse519741615886584\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse519741615886584\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:04.833632+00:00\",\"modified_at\":\"2021-03-16T09:23:04.833632+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse519741615886593\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse519741615886593\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:13.154433+00:00\",\"modified_at\":\"2021-03-16T09:23:13.154433+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse519741615886593\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse519741615886593\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:13.517437+00:00\",\"modified_at\":\"2021-03-16T09:23:13.517437+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1615998271598\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-17T16:24:31.959292+00:00\",\"modified_at\":\"2021-03-17T16:24:31.959292+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616160199767\",\"attributes\":{\"tags\":[\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616160199767\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:19.857702+00:00\",\"modified_at\":\"2021-03-19T13:23:19.857702+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse161616020553\",\"attributes\":{\"tags\":[\"TypescriptListtagsbymetricnamereturnsSuccessresponse161616020553\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:25.631513+00:00\",\"modified_at\":\"2021-03-19T13:23:25.631513+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1616160200146\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1616160200146\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:20.232463+00:00\",\"modified_at\":\"2021-03-19T13:23:20.232463+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616160198595\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:18.718201+00:00\",\"modified_at\":\"2021-03-19T13:23:18.718201+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616160198921\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616160198921\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:19.038247+00:00\",\"modified_at\":\"2021-03-19T13:23:19.038247+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616160199415\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616160199415\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:19.493780+00:00\",\"modified_at\":\"2021-03-19T13:23:19.493780+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1616160205992\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1616160205992\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:26.079138+00:00\",\"modified_at\":\"2021-03-19T13:23:26.079138+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615998272487\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615998272487\"],\"include_percentiles\":false,\"created_at\":\"2021-03-17T16:24:32.839382+00:00\",\"modified_at\":\"2021-03-17T16:24:32.839382+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616149776487\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T10:29:36.901071+00:00\",\"modified_at\":\"2021-03-19T10:29:36.901071+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse161628985592\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-21T01:24:16.278639+00:00\",\"modified_at\":\"2021-03-21T01:24:16.826616+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1616085123642229\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1616085123642229\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:03.966633+00:00\",\"modified_at\":\"2021-03-18T16:32:03.966633+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616085131743281\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616085131743281\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:12.060863+00:00\",\"modified_at\":\"2021-03-18T16:32:12.060863+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616085146387336\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616085146387336\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:26.695646+00:00\",\"modified_at\":\"2021-03-18T16:32:26.695646+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1616085149782964\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1616085149782964\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:30.080251+00:00\",\"modified_at\":\"2021-03-18T16:32:30.080251+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse537181616565902\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse537181616565902\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:05:02.364811+00:00\",\"modified_at\":\"2021-03-24T06:05:02.364811+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse537181616565901\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse537181616565901\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:05:01.875172+00:00\",\"modified_at\":\"2021-03-24T06:05:01.875172+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse537181616565893\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse537181616565893\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:53.937128+00:00\",\"modified_at\":\"2021-03-24T06:04:53.937128+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse537181616565895\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse537181616565895\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:55.311874+00:00\",\"modified_at\":\"2021-03-24T06:04:55.311874+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioCreateatagconfigurationreturnsCreatedresponse537181616565893\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:53.604451+00:00\",\"modified_at\":\"2021-03-24T06:04:53.604451+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse537181616565894\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse537181616565894\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:54.427149+00:00\",\"modified_at\":\"2021-03-24T06:04:54.427149+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse537181616565894\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse537181616565894\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:54.866614+00:00\",\"modified_at\":\"2021-03-24T06:04:54.866614+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse161641942819\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:48.550450+00:00\",\"modified_at\":\"2021-03-22T13:23:48.550450+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1616419438471\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1616419438471\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:58.847497+00:00\",\"modified_at\":\"2021-03-22T13:23:58.847497+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616419430386\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616419430386\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:50.744154+00:00\",\"modified_at\":\"2021-03-22T13:23:50.744154+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616419429059\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616419429059\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:49.434641+00:00\",\"modified_at\":\"2021-03-22T13:23:49.434641+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse161641943169\",\"attributes\":{\"tags\":[\"TypescriptListtagconfigurationbynamereturnsSuccessresponse161641943169\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:52.032469+00:00\",\"modified_at\":\"2021-03-22T13:23:52.032469+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1616419432884\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1616419432884\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:53.144380+00:00\",\"modified_at\":\"2021-03-22T13:23:53.144380+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse532071616436253\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse532071616436253\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T18:04:13.105380+00:00\",\"modified_at\":\"2021-03-22T18:04:13.105380+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse532071616436253\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse532071616436253\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T18:04:13.474151+00:00\",\"modified_at\":\"2021-03-22T18:04:13.474151+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616671077838552\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616671077838552\"],\"include_percentiles\":false,\"created_at\":\"2021-03-25T11:17:58.568334+00:00\",\"modified_at\":\"2021-03-25T11:17:58.568334+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1616752499902025\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1616752499902025\"],\"include_percentiles\":false,\"created_at\":\"2021-03-26T09:55:00.209674+00:00\",\"modified_at\":\"2021-03-26T09:55:00.209674+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616492360346493\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616492360346493\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T09:39:20.746200+00:00\",\"modified_at\":\"2021-03-23T09:39:20.746200+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616495055838\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T10:24:16.190783+00:00\",\"modified_at\":\"2021-03-23T10:24:16.190783+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616498654\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616498654\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:14.161383+00:00\",\"modified_at\":\"2021-03-23T11:24:14.161383+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagconfigurationbynamereturnsSuccessresponse1616498654\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagconfigurationbynamereturnsSuccessresponse1616498654\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:14.567372+00:00\",\"modified_at\":\"2021-03-23T11:24:14.567372+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyDeleteatagconfigurationreturnsNoContentresponse1616498653\",\"attributes\":{\"tags\":[\"rubyDeleteatagconfigurationreturnsNoContentresponse1616498653\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:13.744787+00:00\",\"modified_at\":\"2021-03-23T11:24:13.744787+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616894650949\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-28T01:24:11.315850+00:00\",\"modified_at\":\"2021-03-28T01:24:11.315850+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1617010239\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T09:30:39.277788+00:00\",\"modified_at\":\"2021-03-29T09:30:39.277788+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616840650426\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616840650426\"],\"include_percentiles\":false,\"created_at\":\"2021-03-27T10:24:10.771619+00:00\",\"modified_at\":\"2021-03-27T10:24:10.771619+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1617013073\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T10:17:53.426838+00:00\",\"modified_at\":\"2021-03-29T10:17:53.426838+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagconfigurationsreturnsSuccessresponse1617013912\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagconfigurationsreturnsSuccessresponse1617013912\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T10:31:52.652432+00:00\",\"modified_at\":\"2021-03-29T10:31:52.652432+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1617014589345712\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T10:43:09.860304+00:00\",\"modified_at\":\"2021-03-29T10:43:09.860304+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse549511617084343\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse549511617084343\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T06:05:43.124191+00:00\",\"modified_at\":\"2021-03-30T06:05:43.124191+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse549511617084343\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse549511617084343\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T06:05:43.601969+00:00\",\"modified_at\":\"2021-03-30T06:05:43.601969+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1617190497075142\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T11:34:57.312061+00:00\",\"modified_at\":\"2021-03-31T11:34:57.312061+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1618116460\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-11T04:47:40.938028+00:00\",\"modified_at\":\"2021-04-11T04:47:40.938028+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1617197102302\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T13:25:02.713019+00:00\",\"modified_at\":\"2021-03-31T13:25:02.713019+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse553521617208533\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse553521617208533\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T16:35:33.822570+00:00\",\"modified_at\":\"2021-03-31T16:35:33.822570+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1617110622671\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1617110622671\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T13:23:42.813575+00:00\",\"modified_at\":\"2021-03-30T13:23:42.813575+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse161711062218\",\"attributes\":{\"tags\":[\"TypescriptListtagsbymetricnamereturnsSuccessresponse161711062218\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T13:23:42.290454+00:00\",\"modified_at\":\"2021-03-30T13:23:42.290454+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1617189605290728\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T11:20:05.512669+00:00\",\"modified_at\":\"2021-03-31T11:20:05.512669+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse550921617127471\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse550921617127471\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T18:04:31.348364+00:00\",\"modified_at\":\"2021-03-30T18:04:31.348364+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse550921617127471\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse550921617127471\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T18:04:31.750754+00:00\",\"modified_at\":\"2021-03-30T18:04:31.750754+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListdistinctmetric1617241055\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListdistinctmetric1617241055\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:35.979950+00:00\",\"modified_at\":\"2021-04-01T01:37:35.979950+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1617241056\",\"attributes\":{\"tags\":[\"javaListtagconfigurati1617241056\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:37.187124+00:00\",\"modified_at\":\"2021-04-01T01:37:37.187124+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1617241057\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagconfigurati1617241057\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:38.337846+00:00\",\"modified_at\":\"2021-04-01T01:37:38.337846+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1617241065\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1617241065\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:46.167234+00:00\",\"modified_at\":\"2021-04-01T01:37:46.167234+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1617629121895\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1617629121895\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:22.245313+00:00\",\"modified_at\":\"2021-04-05T13:25:22.245313+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1617629119345\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1617629119345\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:19.715171+00:00\",\"modified_at\":\"2021-04-05T13:25:19.715171+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1617629117988\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1617629117988\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:18.355397+00:00\",\"modified_at\":\"2021-04-05T13:25:18.355397+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1617629120639\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1617629120639\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:20.999352+00:00\",\"modified_at\":\"2021-04-05T13:25:20.999352+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1617629131797\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1617629131797\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:32.056313+00:00\",\"modified_at\":\"2021-04-05T13:25:32.056313+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyDeleteatagconfigurationreturnsNoContentresponse1617414463\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyDeleteatagconfigurationreturnsNoContentresponse1617414463\"],\"include_percentiles\":false,\"created_at\":\"2021-04-03T01:47:43.121903+00:00\",\"modified_at\":\"2021-04-03T01:47:43.121903+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse161776946527\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-07T04:24:25.610201+00:00\",\"modified_at\":\"2021-04-07T04:24:25.610201+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"tf_TestAccDatadogMetricTagConfiguration_import_57079_1617883575\",\"attributes\":{\"tags\":[\"datacenter\",\"sport\"],\"include_percentiles\":false,\"created_at\":\"2021-04-08T12:06:15.682733+00:00\",\"modified_at\":\"2021-04-08T12:06:15.682733+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"tf_TestAccDatadogMetricTagConfiguration_Basic_57079_1617883576\",\"attributes\":{\"tags\":[\"datacenter\",\"sport\"],\"include_percentiles\":false,\"created_at\":\"2021-04-08T12:06:16.328512+00:00\",\"modified_at\":\"2021-04-08T12:06:16.328512+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagconfigurationbynamereturnsSuccessresponse1617878848\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagconfigurationbynamereturnsSuccessresponse1617878848\"],\"include_percentiles\":false,\"created_at\":\"2021-04-08T10:47:28.651054+00:00\",\"modified_at\":\"2021-04-08T10:47:28.651054+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245205\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245205\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:33:26.065648+00:00\",\"modified_at\":\"2021-04-12T16:33:26.065648+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245209\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245209\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:33:29.921161+00:00\",\"modified_at\":\"2021-04-12T16:33:29.921161+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestGoUpdateatagconfigurationreturnsOKresponse1618245210\",\"attributes\":{\"tags\":[\"TestGoUpdateatagconfigurationreturnsOKresponse1618245210\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:33:30.912740+00:00\",\"modified_at\":\"2021-04-12T16:33:30.912740+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestListtagsbymetricnamereturnsSuccessresponse1618083821\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestListtagsbymetricnamereturnsSuccessresponse1618083821\"],\"include_percentiles\":false,\"created_at\":\"2021-04-10T19:43:42.330061+00:00\",\"modified_at\":\"2021-04-10T19:43:42.330061+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyUpdateatagconfigurationreturnsOKresponse1618477782\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyUpdateatagconfigurationreturnsOKresponse1618477782\"],\"include_percentiles\":false,\"created_at\":\"2021-04-15T09:09:42.695934+00:00\",\"modified_at\":\"2021-04-15T09:09:42.695934+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptUpdateatagconfigurationreturnsOKresponse1618576969\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-16T12:42:49.127510+00:00\",\"modified_at\":\"2021-04-16T12:42:49.222085+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationsreturnsSuccessresponse1618576965\",\"attributes\":{\"tags\":[\"TestPythonListtagconfigurationsreturnsSuccessresponse1618576965\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-16T12:42:45.376840+00:00\",\"modified_at\":\"2021-04-16T12:42:45.376840+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptUpdateatagconfigurationreturnsOKresponse1618828174\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T10:29:34.758064+00:00\",\"modified_at\":\"2021-04-19T10:29:34.863258+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationsreturnsSuccessresponse1618828169\",\"attributes\":{\"tags\":[\"TestPythonListtagconfigurationsreturnsSuccessresponse1618828169\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T10:29:28.829677+00:00\",\"modified_at\":\"2021-04-19T10:29:28.829677+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestGoListtagconfigurationsreturnsSuccessresponse1618835558\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestGoListtagconfigurationsreturnsSuccessresponse1618835558\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T12:32:38.361429+00:00\",\"modified_at\":\"2021-04-19T12:32:38.361429+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1618817102\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1618817102\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T07:25:02.613361+00:00\",\"modified_at\":\"2021-04-19T07:25:02.613361+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618831533\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618831533\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T11:25:33.764565+00:00\",\"modified_at\":\"2021-04-19T11:25:33.764565+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618827476\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618827476\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T10:17:56.919641+00:00\",\"modified_at\":\"2021-04-19T10:17:56.919641+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagsbymetricnamereturnsSuccessresponse1618861041\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagsbymetricnamereturnsSuccessresponse1618861041\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T19:37:21.909413+00:00\",\"modified_at\":\"2021-04-19T19:37:21.909413+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1618883262\",\"attributes\":{\"tags\":[\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1618883262\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-20T01:47:42.978537+00:00\",\"modified_at\":\"2021-04-20T01:47:42.978537+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619096218\",\"attributes\":{\"tags\":[\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619096218\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T12:56:58.362386+00:00\",\"modified_at\":\"2021-04-22T12:56:58.362386+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonCreateatagconfigurationreturnsCreatedresponse1619097915\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T13:25:31.443839+00:00\",\"modified_at\":\"2021-04-22T13:25:31.443839+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1619097911\",\"attributes\":{\"tags\":[\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1619097911\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T13:25:11.404186+00:00\",\"modified_at\":\"2021-04-22T13:25:11.404186+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListtagconfigurationsreturnsSuccessresponse1619096210\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestTypescriptListtagconfigurationsreturnsSuccessresponse1619096210\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T12:56:51.186137+00:00\",\"modified_at\":\"2021-04-22T12:56:51.186137+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagsbymetricnamereturnsSuccessresponse1619131204\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagsbymetricnamereturnsSuccessresponse1619131204\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T22:40:04.866275+00:00\",\"modified_at\":\"2021-04-22T22:40:04.866275+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationsreturnsSuccessresponse1619175153\",\"attributes\":{\"tags\":[\"datacenter\",\"TestJavaListtagconfigurationsreturnsSuccessresponse1619175153\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-23T10:52:33.873612+00:00\",\"modified_at\":\"2021-04-23T10:52:33.873612+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619175155\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestTypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619175155\"],\"include_percentiles\":false,\"created_at\":\"2021-04-23T10:52:35.693831+00:00\",\"modified_at\":\"2021-04-23T10:52:35.693831+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619282121\",\"attributes\":{\"tags\":[\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619282121\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T16:35:22.034065+00:00\",\"modified_at\":\"2021-04-24T16:35:22.034065+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyCreateatagconfigurationreturnsCreatedresponse1619228878\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:47:59.109548+00:00\",\"modified_at\":\"2021-04-24T01:47:59.109548+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyDeleteatagconfigurationreturnsNoContentresponse1619228879\",\"attributes\":{\"tags\":[\"TestRubyDeleteatagconfigurationreturnsNoContentresponse1619228879\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:47:59.465861+00:00\",\"modified_at\":\"2021-04-24T01:47:59.465861+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyUpdateatagconfigurationreturnsOKresponse1619228888\",\"attributes\":{\"tags\":[\"TestRubyUpdateatagconfigurationreturnsOKresponse1619228888\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:48:08.955735+00:00\",\"modified_at\":\"2021-04-24T01:48:08.955735+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619228879\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619228879\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:47:59.924705+00:00\",\"modified_at\":\"2021-04-24T01:47:59.924705+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1619228880\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1619228880\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:48:00.601042+00:00\",\"modified_at\":\"2021-04-24T01:48:00.601042+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagsbymetricnamereturnsSuccessresponse1619228888\",\"attributes\":{\"tags\":[\"TestRubyListtagsbymetricnamereturnsSuccessresponse1619228888\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:48:08.489900+00:00\",\"modified_at\":\"2021-04-24T01:48:08.489900+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonCreateatagconfigurationreturnsCreatedresponse1619421459\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-26T07:17:40.163589+00:00\",\"modified_at\":\"2021-04-26T07:17:40.163589+00:00\",\"metric_type\":\"distribution\"}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 625, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-08-05T07:10:55.086Z", + "time": 1774 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-a-tag-filter-returns-Success-response_2147147172/frozen.json b/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-a-tag-filter-returns-Success-response_2147147172/frozen.json new file mode 100644 index 000000000000..08d95882b85b --- /dev/null +++ b/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-a-tag-filter-returns-Success-response_2147147172/frozen.json @@ -0,0 +1 @@ +"2022-09-01T11:59:10.865Z" diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-a-tag-filter-returns-Success-response_2147147172/recording.har b/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-a-tag-filter-returns-Success-response_2147147172/recording.har new file mode 100644 index 000000000000..6d39a889b49f --- /dev/null +++ b/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-a-tag-filter-returns-Success-response_2147147172/recording.har @@ -0,0 +1,64 @@ +{ + "log": { + "_recordingName": "Metrics/Get a list of metrics with a tag filter returns \"Success\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "c37035a23cf90c4730799b6d7943735d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 594, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "filter", + "value": { + "tags": "TestGetalistofmetricswithatagfilterreturnsSuccessresponse1662033550" + } + } + ], + "url": "https://api.datadoghq.com/api/v2/metrics?filter%5Btags%5D=TestGetalistofmetricswithatagfilterreturnsSuccessresponse1662033550" + }, + "response": { + "bodySize": 12, + "content": { + "mimeType": "application/json", + "size": 12, + "text": "{\"data\":[]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 599, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-01T11:59:10.875Z", + "time": 487 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-configured-filter-returns-Success-response_2949073099/frozen.json b/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-configured-filter-returns-Success-response_2949073099/frozen.json new file mode 100644 index 000000000000..c327ca6da43e --- /dev/null +++ b/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-configured-filter-returns-Success-response_2949073099/frozen.json @@ -0,0 +1 @@ +"2022-09-01T11:59:49.583Z" diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-configured-filter-returns-Success-response_2949073099/recording.har b/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-configured-filter-returns-Success-response_2949073099/recording.har new file mode 100644 index 000000000000..1413d3a4afc2 --- /dev/null +++ b/cassettes/v2/Metrics_2046978582/Get-a-list-of-metrics-with-configured-filter-returns-Success-response_2949073099/recording.har @@ -0,0 +1,64 @@ +{ + "log": { + "_recordingName": "Metrics/Get a list of metrics with configured filter returns \"Success\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "6a6c3737116332b63162f7d3bcb05a06", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 537, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "filter", + "value": { + "configured": "true" + } + } + ], + "url": "https://api.datadoghq.com/api/v2/metrics?filter%5Bconfigured%5D=true" + }, + "response": { + "bodySize": 61346, + "content": { + "mimeType": "application/json", + "size": 61346, + "text": "{\"data\":[{\"type\":\"manage_tags\",\"id\":\"test.metric.1\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"created_at\":\"2022-03-24T18:23:55.957002+00:00\",\"modified_at\":\"2022-03-28T14:34:32.618807+00:00\",\"metric_type\":\"gauge\",\"aggregations\":[{\"space\":\"avg\",\"time\":\"avg\"}]}},{\"type\":\"manage_tags\",\"id\":\"foo\",\"attributes\":{\"tags\":[\"datacenter\",\"sport\"],\"created_at\":\"2021-10-27T12:35:56.242671+00:00\",\"modified_at\":\"2021-10-27T12:41:22.413540+00:00\",\"metric_type\":\"count\",\"aggregations\":[{\"space\":\"sum\",\"time\":\"sum\"}]}},{\"type\":\"manage_tags\",\"id\":\"ExampleListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1653177320\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"ExampleListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1653177320\"],\"created_at\":\"2022-05-21T23:55:28.435000+00:00\",\"modified_at\":\"2022-05-21T23:55:28.435000+00:00\",\"metric_type\":\"gauge\",\"aggregations\":[{\"space\":\"avg\",\"time\":\"avg\"}]}},{\"type\":\"manage_tags\",\"id\":\"javaCreateatagconfigu1617241053\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:34.078032+00:00\",\"modified_at\":\"2021-05-07T09:02:37.581544+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1616498653\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:13.435931+00:00\",\"modified_at\":\"2021-03-23T11:24:13.435931+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagsbymetricnamereturnsSuccessresponse1618241083\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListtagsbymetricnamereturnsSuccessresponse1618241083\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T15:24:43.937851+00:00\",\"modified_at\":\"2021-04-12T15:24:43.937851+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioCreateaTagConfigurationreturnsCreatedresponse462771613138431\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.059033+00:00\",\"modified_at\":\"2021-02-12T14:00:32.059033+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioDeleteaTagConfigurationreturnsNoContentresponse462771613138432\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioDeleteaTagConfigurationreturnsNoContentresponse462771613138432\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.286794+00:00\",\"modified_at\":\"2021-02-12T14:00:32.286794+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse462771613138432\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse462771613138432\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.668585+00:00\",\"modified_at\":\"2021-02-12T14:00:32.668585+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListTagConfigurationsreturnsSuccessresponse462771613138432\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListTagConfigurationsreturnsSuccessresponse462771613138432\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.953685+00:00\",\"modified_at\":\"2021-02-12T14:00:32.953685+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateaTagConfigurationreturnsOKresponse462771613138437\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateaTagConfigurationreturnsOKresponse462771613138437\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:37.707422+00:00\",\"modified_at\":\"2021-02-12T14:00:37.707422+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1613308647656458\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-14T13:17:28.200159+00:00\",\"modified_at\":\"2021-02-14T13:17:28.200159+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaDeleteaTagConfigu1613601517\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaDeleteaTagConfigu1613601517\"],\"include_percentiles\":false,\"created_at\":\"2021-02-17T22:38:38.226434+00:00\",\"modified_at\":\"2021-02-17T22:38:38.226434+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613674911438\",\"attributes\":{\"tags\":[\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613674911438\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:51.701561+00:00\",\"modified_at\":\"2021-02-18T19:01:51.701561+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateaTagConfigurationreturnsCreatedresponse1613674910068\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:50.346751+00:00\",\"modified_at\":\"2021-02-18T19:01:50.346751+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationsreturnsSuccessresponse1613674912224\",\"attributes\":{\"tags\":[\"TypescriptListTagConfigurationsreturnsSuccessresponse1613674912224\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:52.489744+00:00\",\"modified_at\":\"2021-02-18T19:01:52.489744+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateaTagConfigurationreturnsOKresponse1613674918621\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:58.909298+00:00\",\"modified_at\":\"2021-02-18T19:01:59.239616+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateaTagConfigurationreturnsCreatedresponse1613675388888\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:49.157042+00:00\",\"modified_at\":\"2021-02-18T19:09:49.157042+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateaTagConfigurationreturnsOKresponse1613675398177\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:58.429942+00:00\",\"modified_at\":\"2021-02-18T19:09:58.778902+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationsreturnsSuccessresponse1613675391059\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListTagConfigurationsreturnsSuccessresponse1613675391059\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:51.329650+00:00\",\"modified_at\":\"2021-02-18T19:09:51.329650+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613675390193\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613675390193\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:50.468784+00:00\",\"modified_at\":\"2021-02-18T19:09:50.468784+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteaTagConfigurationreturnsNoContentresponse1613676227224\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptDeleteaTagConfigurationreturnsNoContentresponse1613676227224\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:23:47.510239+00:00\",\"modified_at\":\"2021-02-18T19:23:47.510239+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1613983335\",\"attributes\":{\"tags\":[\"javaUpdateaTagConfigu1613983335\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-22T08:42:15.339339+00:00\",\"modified_at\":\"2021-02-22T08:42:15.339339+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1613983337447904\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1613983337447904\"],\"include_percentiles\":false,\"created_at\":\"2021-02-22T08:42:17.877627+00:00\",\"modified_at\":\"2021-02-22T08:42:17.877627+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateaTagConfigurationreturnsCreatedresponse1613983377189\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-22T08:42:57.496771+00:00\",\"modified_at\":\"2021-02-22T08:42:57.496771+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse489431614557161\",\"attributes\":{\"tags\":[\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse489431614557161\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-01T00:06:01.798862+00:00\",\"modified_at\":\"2021-03-01T00:06:01.798862+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1614290498\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateaTagConfigu1614290498\"],\"include_percentiles\":false,\"created_at\":\"2021-02-25T22:01:38.735081+00:00\",\"modified_at\":\"2021-02-25T22:01:38.735081+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1614648774\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateaTagConfigu1614648774\"],\"include_percentiles\":false,\"created_at\":\"2021-03-02T01:32:55.019781+00:00\",\"modified_at\":\"2021-03-02T01:32:55.019781+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1612987674596336\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1612987674596336\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:54.979797+00:00\",\"modified_at\":\"2021-03-03T22:28:32.386290+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1612987679233002\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:59.516348+00:00\",\"modified_at\":\"2021-03-03T20:42:09.521631+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagconfigurationsreturnssuccessresponse1612987675260358\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagconfigurationsreturnssuccessresponse1612987675260358\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:55.559669+00:00\",\"modified_at\":\"2021-03-03T20:45:46.030871+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateaTagConfigurationreturnsOKresponse1614821029942\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptUpdateaTagConfigurationreturnsOKresponse1614821029942\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T01:23:50.307273+00:00\",\"modified_at\":\"2021-03-04T01:23:50.307273+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1614632066664577\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1614632066664577\"],\"include_percentiles\":false,\"created_at\":\"2021-03-01T20:54:26.950587+00:00\",\"modified_at\":\"2021-03-03T19:53:57.601421+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1612987678724128\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1612987678724128\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:59.011905+00:00\",\"modified_at\":\"2021-03-03T19:54:03.012021+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1614907949\",\"attributes\":{\"tags\":[\"javaUpdateaTagConfigu1614907949\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:29.891018+00:00\",\"modified_at\":\"2021-03-05T01:32:29.891018+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListTagConfigurati1614907942\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListTagConfigurati1614907942\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:22.257630+00:00\",\"modified_at\":\"2021-03-05T01:32:22.779595+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaCreateaTagConfigu1614907941\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:21.472249+00:00\",\"modified_at\":\"2021-03-05T01:32:21.472249+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaDeleteaTagConfigu1614907941\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaDeleteaTagConfigu1614907941\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:21.840312+00:00\",\"modified_at\":\"2021-03-05T01:32:21.840312+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1614877824877072\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1614877824877072\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T17:10:25.408162+00:00\",\"modified_at\":\"2021-03-04T18:03:35.564866+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse161487782309652\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse161487782309652\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T17:10:23.841708+00:00\",\"modified_at\":\"2021-03-04T18:03:25.853564+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1614878558721298\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1614878558721298\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T17:22:39.122261+00:00\",\"modified_at\":\"2021-03-04T18:03:33.352006+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1612987679647768\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1612987679647768\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:59.946457+00:00\",\"modified_at\":\"2021-03-04T09:39:37.370474+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1614962335\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1614962335\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T16:38:55.946186+00:00\",\"modified_at\":\"2021-03-05T16:38:55.946186+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateatagconfigu1614962336\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateatagconfigu1614962336\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T16:38:56.440191+00:00\",\"modified_at\":\"2021-03-05T16:38:56.440191+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1614984109\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1614984109\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T22:41:50.029868+00:00\",\"modified_at\":\"2021-03-05T22:41:50.029868+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse505431615205163\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse505431615205163\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T12:06:03.965736+00:00\",\"modified_at\":\"2021-03-08T12:06:03.965736+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaCreateatagconfigu1615195320\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:00.581891+00:00\",\"modified_at\":\"2021-03-08T09:22:00.581891+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListdistinctmetric1615195322\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListdistinctmetric1615195322\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:02.640568+00:00\",\"modified_at\":\"2021-03-08T09:22:02.640568+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaDeleteatagconfigu1615195321\",\"attributes\":{\"tags\":[\"javaDeleteatagconfigu1615195321\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:01.374349+00:00\",\"modified_at\":\"2021-03-08T09:22:01.374349+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1615195323\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagconfigurati1615195323\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:03.733804+00:00\",\"modified_at\":\"2021-03-08T09:22:03.733804+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1615195324\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagconfigurati1615195324\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:04.847552+00:00\",\"modified_at\":\"2021-03-08T09:22:04.847552+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1615195329\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1615195329\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:10.192146+00:00\",\"modified_at\":\"2021-03-08T09:22:10.192146+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateatagconfigu1615195330\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateatagconfigu1615195330\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:11.353873+00:00\",\"modified_at\":\"2021-03-08T09:22:11.353873+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615241008139\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615241008139\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T22:03:28.250137+00:00\",\"modified_at\":\"2021-03-08T22:03:28.250137+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagconfigurationsreturnsSuccessresponse1618243860\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListtagconfigurationsreturnsSuccessresponse1618243860\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:11:00.453385+00:00\",\"modified_at\":\"2021-04-12T16:11:00.453385+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse507811615269834\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse507811615269834\"],\"include_percentiles\":false,\"created_at\":\"2021-03-09T06:03:55.035011+00:00\",\"modified_at\":\"2021-03-09T06:03:55.035011+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1615289582\",\"attributes\":{\"tags\":[\"javaListtagconfigurati1615289582\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-09T11:33:02.415435+00:00\",\"modified_at\":\"2021-03-09T11:33:02.415435+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse511141615397094\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse511141615397094\"],\"include_percentiles\":false,\"created_at\":\"2021-03-10T17:24:54.232169+00:00\",\"modified_at\":\"2021-03-10T17:24:54.232169+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse511141615397093\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse511141615397093\"],\"include_percentiles\":false,\"created_at\":\"2021-03-10T17:24:53.773142+00:00\",\"modified_at\":\"2021-03-10T17:24:53.773142+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagsbymetricnamereturnsSuccessresponse1615600096\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagsbymetricnamereturnsSuccessresponse1615600096\"],\"include_percentiles\":false,\"created_at\":\"2021-03-13T01:48:16.706740+00:00\",\"modified_at\":\"2021-03-13T01:48:16.706740+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyUpdateatagconfigurationreturnsOKresponse1615600097\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyUpdateatagconfigurationreturnsOKresponse1615600097\"],\"include_percentiles\":false,\"created_at\":\"2021-03-13T01:48:17.311123+00:00\",\"modified_at\":\"2021-03-13T01:48:17.311123+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615641825358\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615641825358\"],\"include_percentiles\":false,\"created_at\":\"2021-03-13T13:23:45.714258+00:00\",\"modified_at\":\"2021-03-13T13:23:45.714258+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1615728221108\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1615728221108\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-14T13:23:41.436621+00:00\",\"modified_at\":\"2021-03-14T13:23:41.436621+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615728219671\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615728219671\"],\"include_percentiles\":false,\"created_at\":\"2021-03-14T13:23:40.016425+00:00\",\"modified_at\":\"2021-03-14T13:23:40.016425+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615901000076\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615901000076\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:20.213657+00:00\",\"modified_at\":\"2021-03-16T13:23:20.213657+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615900999594\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615900999594\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:19.703100+00:00\",\"modified_at\":\"2021-03-16T13:23:19.703100+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1615901001052\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1615901001052\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:21.193223+00:00\",\"modified_at\":\"2021-03-16T13:23:21.193223+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1615900999263\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:19.393024+00:00\",\"modified_at\":\"2021-03-16T13:23:19.393024+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1615901000614\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1615901000614\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:20.718208+00:00\",\"modified_at\":\"2021-03-16T13:23:20.718208+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615901006889\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615901006889\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:27.006017+00:00\",\"modified_at\":\"2021-03-16T13:23:27.006017+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1615901007411\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1615901007411\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:27.541142+00:00\",\"modified_at\":\"2021-03-16T13:23:27.541142+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse519741615886584\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse519741615886584\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:04.506963+00:00\",\"modified_at\":\"2021-03-16T09:23:04.506963+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse519741615886584\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse519741615886584\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:04.173080+00:00\",\"modified_at\":\"2021-03-16T09:23:04.173080+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse519741615886585\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse519741615886585\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:05.166846+00:00\",\"modified_at\":\"2021-03-16T09:23:05.166846+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioCreateatagconfigurationreturnsCreatedresponse519741615886583\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:03.873546+00:00\",\"modified_at\":\"2021-03-16T09:23:03.873546+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse519741615886584\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse519741615886584\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:04.833632+00:00\",\"modified_at\":\"2021-03-16T09:23:04.833632+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse519741615886593\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse519741615886593\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:13.154433+00:00\",\"modified_at\":\"2021-03-16T09:23:13.154433+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse519741615886593\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse519741615886593\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:13.517437+00:00\",\"modified_at\":\"2021-03-16T09:23:13.517437+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1615998271598\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-17T16:24:31.959292+00:00\",\"modified_at\":\"2021-03-17T16:24:31.959292+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616160199767\",\"attributes\":{\"tags\":[\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616160199767\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:19.857702+00:00\",\"modified_at\":\"2021-03-19T13:23:19.857702+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse161616020553\",\"attributes\":{\"tags\":[\"TypescriptListtagsbymetricnamereturnsSuccessresponse161616020553\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:25.631513+00:00\",\"modified_at\":\"2021-03-19T13:23:25.631513+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1616160200146\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1616160200146\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:20.232463+00:00\",\"modified_at\":\"2021-03-19T13:23:20.232463+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616160198595\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:18.718201+00:00\",\"modified_at\":\"2021-03-19T13:23:18.718201+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616160198921\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616160198921\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:19.038247+00:00\",\"modified_at\":\"2021-03-19T13:23:19.038247+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616160199415\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616160199415\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:19.493780+00:00\",\"modified_at\":\"2021-03-19T13:23:19.493780+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1616160205992\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1616160205992\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:26.079138+00:00\",\"modified_at\":\"2021-03-19T13:23:26.079138+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615998272487\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615998272487\"],\"include_percentiles\":false,\"created_at\":\"2021-03-17T16:24:32.839382+00:00\",\"modified_at\":\"2021-03-17T16:24:32.839382+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616149776487\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T10:29:36.901071+00:00\",\"modified_at\":\"2021-03-19T10:29:36.901071+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse161628985592\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-21T01:24:16.278639+00:00\",\"modified_at\":\"2021-03-21T01:24:16.826616+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1616085123642229\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1616085123642229\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:03.966633+00:00\",\"modified_at\":\"2021-03-18T16:32:03.966633+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616085131743281\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616085131743281\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:12.060863+00:00\",\"modified_at\":\"2021-03-18T16:32:12.060863+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616085146387336\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616085146387336\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:26.695646+00:00\",\"modified_at\":\"2021-03-18T16:32:26.695646+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1616085149782964\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1616085149782964\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:30.080251+00:00\",\"modified_at\":\"2021-03-18T16:32:30.080251+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse537181616565902\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse537181616565902\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:05:02.364811+00:00\",\"modified_at\":\"2021-03-24T06:05:02.364811+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse537181616565901\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse537181616565901\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:05:01.875172+00:00\",\"modified_at\":\"2021-03-24T06:05:01.875172+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse537181616565893\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse537181616565893\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:53.937128+00:00\",\"modified_at\":\"2021-03-24T06:04:53.937128+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse537181616565895\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse537181616565895\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:55.311874+00:00\",\"modified_at\":\"2021-03-24T06:04:55.311874+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioCreateatagconfigurationreturnsCreatedresponse537181616565893\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:53.604451+00:00\",\"modified_at\":\"2021-03-24T06:04:53.604451+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse537181616565894\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse537181616565894\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:54.427149+00:00\",\"modified_at\":\"2021-03-24T06:04:54.427149+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse537181616565894\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse537181616565894\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:54.866614+00:00\",\"modified_at\":\"2021-03-24T06:04:54.866614+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse161641942819\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:48.550450+00:00\",\"modified_at\":\"2021-03-22T13:23:48.550450+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1616419438471\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1616419438471\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:58.847497+00:00\",\"modified_at\":\"2021-03-22T13:23:58.847497+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616419430386\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616419430386\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:50.744154+00:00\",\"modified_at\":\"2021-03-22T13:23:50.744154+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616419429059\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616419429059\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:49.434641+00:00\",\"modified_at\":\"2021-03-22T13:23:49.434641+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse161641943169\",\"attributes\":{\"tags\":[\"TypescriptListtagconfigurationbynamereturnsSuccessresponse161641943169\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:52.032469+00:00\",\"modified_at\":\"2021-03-22T13:23:52.032469+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1616419432884\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1616419432884\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:53.144380+00:00\",\"modified_at\":\"2021-03-22T13:23:53.144380+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse532071616436253\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse532071616436253\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T18:04:13.105380+00:00\",\"modified_at\":\"2021-03-22T18:04:13.105380+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse532071616436253\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse532071616436253\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T18:04:13.474151+00:00\",\"modified_at\":\"2021-03-22T18:04:13.474151+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616671077838552\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616671077838552\"],\"include_percentiles\":false,\"created_at\":\"2021-03-25T11:17:58.568334+00:00\",\"modified_at\":\"2021-03-25T11:17:58.568334+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1616752499902025\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1616752499902025\"],\"include_percentiles\":false,\"created_at\":\"2021-03-26T09:55:00.209674+00:00\",\"modified_at\":\"2021-03-26T09:55:00.209674+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616492360346493\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616492360346493\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T09:39:20.746200+00:00\",\"modified_at\":\"2021-03-23T09:39:20.746200+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616495055838\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T10:24:16.190783+00:00\",\"modified_at\":\"2021-03-23T10:24:16.190783+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616498654\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616498654\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:14.161383+00:00\",\"modified_at\":\"2021-03-23T11:24:14.161383+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagconfigurationbynamereturnsSuccessresponse1616498654\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagconfigurationbynamereturnsSuccessresponse1616498654\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:14.567372+00:00\",\"modified_at\":\"2021-03-23T11:24:14.567372+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyDeleteatagconfigurationreturnsNoContentresponse1616498653\",\"attributes\":{\"tags\":[\"rubyDeleteatagconfigurationreturnsNoContentresponse1616498653\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:13.744787+00:00\",\"modified_at\":\"2021-03-23T11:24:13.744787+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616894650949\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-28T01:24:11.315850+00:00\",\"modified_at\":\"2021-03-28T01:24:11.315850+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1617010239\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T09:30:39.277788+00:00\",\"modified_at\":\"2021-03-29T09:30:39.277788+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616840650426\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616840650426\"],\"include_percentiles\":false,\"created_at\":\"2021-03-27T10:24:10.771619+00:00\",\"modified_at\":\"2021-03-27T10:24:10.771619+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1617013073\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T10:17:53.426838+00:00\",\"modified_at\":\"2021-03-29T10:17:53.426838+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagconfigurationsreturnsSuccessresponse1617013912\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagconfigurationsreturnsSuccessresponse1617013912\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T10:31:52.652432+00:00\",\"modified_at\":\"2021-03-29T10:31:52.652432+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1617014589345712\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T10:43:09.860304+00:00\",\"modified_at\":\"2021-03-29T10:43:09.860304+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse549511617084343\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse549511617084343\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T06:05:43.124191+00:00\",\"modified_at\":\"2021-03-30T06:05:43.124191+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse549511617084343\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse549511617084343\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T06:05:43.601969+00:00\",\"modified_at\":\"2021-03-30T06:05:43.601969+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1617190497075142\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T11:34:57.312061+00:00\",\"modified_at\":\"2021-03-31T11:34:57.312061+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1618116460\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-11T04:47:40.938028+00:00\",\"modified_at\":\"2021-04-11T04:47:40.938028+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1617197102302\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T13:25:02.713019+00:00\",\"modified_at\":\"2021-03-31T13:25:02.713019+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse553521617208533\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse553521617208533\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T16:35:33.822570+00:00\",\"modified_at\":\"2021-03-31T16:35:33.822570+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1617110622671\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1617110622671\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T13:23:42.813575+00:00\",\"modified_at\":\"2021-03-30T13:23:42.813575+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse161711062218\",\"attributes\":{\"tags\":[\"TypescriptListtagsbymetricnamereturnsSuccessresponse161711062218\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T13:23:42.290454+00:00\",\"modified_at\":\"2021-03-30T13:23:42.290454+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1617189605290728\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T11:20:05.512669+00:00\",\"modified_at\":\"2021-03-31T11:20:05.512669+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse550921617127471\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse550921617127471\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T18:04:31.348364+00:00\",\"modified_at\":\"2021-03-30T18:04:31.348364+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse550921617127471\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse550921617127471\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T18:04:31.750754+00:00\",\"modified_at\":\"2021-03-30T18:04:31.750754+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListdistinctmetric1617241055\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListdistinctmetric1617241055\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:35.979950+00:00\",\"modified_at\":\"2021-04-01T01:37:35.979950+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1617241056\",\"attributes\":{\"tags\":[\"javaListtagconfigurati1617241056\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:37.187124+00:00\",\"modified_at\":\"2021-04-01T01:37:37.187124+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1617241057\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagconfigurati1617241057\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:38.337846+00:00\",\"modified_at\":\"2021-04-01T01:37:38.337846+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1617241065\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1617241065\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:46.167234+00:00\",\"modified_at\":\"2021-04-01T01:37:46.167234+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1617629121895\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1617629121895\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:22.245313+00:00\",\"modified_at\":\"2021-04-05T13:25:22.245313+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1617629119345\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1617629119345\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:19.715171+00:00\",\"modified_at\":\"2021-04-05T13:25:19.715171+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1617629117988\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1617629117988\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:18.355397+00:00\",\"modified_at\":\"2021-04-05T13:25:18.355397+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1617629120639\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1617629120639\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:20.999352+00:00\",\"modified_at\":\"2021-04-05T13:25:20.999352+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1617629131797\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1617629131797\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:32.056313+00:00\",\"modified_at\":\"2021-04-05T13:25:32.056313+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyDeleteatagconfigurationreturnsNoContentresponse1617414463\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyDeleteatagconfigurationreturnsNoContentresponse1617414463\"],\"include_percentiles\":false,\"created_at\":\"2021-04-03T01:47:43.121903+00:00\",\"modified_at\":\"2021-04-03T01:47:43.121903+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse161776946527\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-07T04:24:25.610201+00:00\",\"modified_at\":\"2021-04-07T04:24:25.610201+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"tf_TestAccDatadogMetricTagConfiguration_import_57079_1617883575\",\"attributes\":{\"tags\":[\"datacenter\",\"sport\"],\"include_percentiles\":false,\"created_at\":\"2021-04-08T12:06:15.682733+00:00\",\"modified_at\":\"2021-04-08T12:06:15.682733+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"tf_TestAccDatadogMetricTagConfiguration_Basic_57079_1617883576\",\"attributes\":{\"tags\":[\"datacenter\",\"sport\"],\"include_percentiles\":false,\"created_at\":\"2021-04-08T12:06:16.328512+00:00\",\"modified_at\":\"2021-04-08T12:06:16.328512+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagconfigurationbynamereturnsSuccessresponse1617878848\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagconfigurationbynamereturnsSuccessresponse1617878848\"],\"include_percentiles\":false,\"created_at\":\"2021-04-08T10:47:28.651054+00:00\",\"modified_at\":\"2021-04-08T10:47:28.651054+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245205\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245205\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:33:26.065648+00:00\",\"modified_at\":\"2021-04-12T16:33:26.065648+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245209\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245209\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:33:29.921161+00:00\",\"modified_at\":\"2021-04-12T16:33:29.921161+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestGoUpdateatagconfigurationreturnsOKresponse1618245210\",\"attributes\":{\"tags\":[\"TestGoUpdateatagconfigurationreturnsOKresponse1618245210\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:33:30.912740+00:00\",\"modified_at\":\"2021-04-12T16:33:30.912740+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestListtagsbymetricnamereturnsSuccessresponse1618083821\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestListtagsbymetricnamereturnsSuccessresponse1618083821\"],\"include_percentiles\":false,\"created_at\":\"2021-04-10T19:43:42.330061+00:00\",\"modified_at\":\"2021-04-10T19:43:42.330061+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyUpdateatagconfigurationreturnsOKresponse1618477782\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyUpdateatagconfigurationreturnsOKresponse1618477782\"],\"include_percentiles\":false,\"created_at\":\"2021-04-15T09:09:42.695934+00:00\",\"modified_at\":\"2021-04-15T09:09:42.695934+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptUpdateatagconfigurationreturnsOKresponse1618576969\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-16T12:42:49.127510+00:00\",\"modified_at\":\"2021-04-16T12:42:49.222085+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationsreturnsSuccessresponse1618576965\",\"attributes\":{\"tags\":[\"TestPythonListtagconfigurationsreturnsSuccessresponse1618576965\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-16T12:42:45.376840+00:00\",\"modified_at\":\"2021-04-16T12:42:45.376840+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptUpdateatagconfigurationreturnsOKresponse1618828174\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T10:29:34.758064+00:00\",\"modified_at\":\"2021-04-19T10:29:34.863258+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationsreturnsSuccessresponse1618828169\",\"attributes\":{\"tags\":[\"TestPythonListtagconfigurationsreturnsSuccessresponse1618828169\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T10:29:28.829677+00:00\",\"modified_at\":\"2021-04-19T10:29:28.829677+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestGoListtagconfigurationsreturnsSuccessresponse1618835558\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestGoListtagconfigurationsreturnsSuccessresponse1618835558\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T12:32:38.361429+00:00\",\"modified_at\":\"2021-04-19T12:32:38.361429+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1618817102\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1618817102\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T07:25:02.613361+00:00\",\"modified_at\":\"2021-04-19T07:25:02.613361+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618831533\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618831533\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T11:25:33.764565+00:00\",\"modified_at\":\"2021-04-19T11:25:33.764565+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618827476\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618827476\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T10:17:56.919641+00:00\",\"modified_at\":\"2021-04-19T10:17:56.919641+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagsbymetricnamereturnsSuccessresponse1618861041\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagsbymetricnamereturnsSuccessresponse1618861041\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T19:37:21.909413+00:00\",\"modified_at\":\"2021-04-19T19:37:21.909413+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1618883262\",\"attributes\":{\"tags\":[\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1618883262\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-20T01:47:42.978537+00:00\",\"modified_at\":\"2021-04-20T01:47:42.978537+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619096218\",\"attributes\":{\"tags\":[\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619096218\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T12:56:58.362386+00:00\",\"modified_at\":\"2021-04-22T12:56:58.362386+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonCreateatagconfigurationreturnsCreatedresponse1619097915\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T13:25:31.443839+00:00\",\"modified_at\":\"2021-04-22T13:25:31.443839+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1619097911\",\"attributes\":{\"tags\":[\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1619097911\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T13:25:11.404186+00:00\",\"modified_at\":\"2021-04-22T13:25:11.404186+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListtagconfigurationsreturnsSuccessresponse1619096210\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestTypescriptListtagconfigurationsreturnsSuccessresponse1619096210\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T12:56:51.186137+00:00\",\"modified_at\":\"2021-04-22T12:56:51.186137+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagsbymetricnamereturnsSuccessresponse1619131204\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagsbymetricnamereturnsSuccessresponse1619131204\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T22:40:04.866275+00:00\",\"modified_at\":\"2021-04-22T22:40:04.866275+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationsreturnsSuccessresponse1619175153\",\"attributes\":{\"tags\":[\"datacenter\",\"TestJavaListtagconfigurationsreturnsSuccessresponse1619175153\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-23T10:52:33.873612+00:00\",\"modified_at\":\"2021-04-23T10:52:33.873612+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619175155\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestTypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619175155\"],\"include_percentiles\":false,\"created_at\":\"2021-04-23T10:52:35.693831+00:00\",\"modified_at\":\"2021-04-23T10:52:35.693831+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619282121\",\"attributes\":{\"tags\":[\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619282121\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T16:35:22.034065+00:00\",\"modified_at\":\"2021-04-24T16:35:22.034065+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyCreateatagconfigurationreturnsCreatedresponse1619228878\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:47:59.109548+00:00\",\"modified_at\":\"2021-04-24T01:47:59.109548+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyDeleteatagconfigurationreturnsNoContentresponse1619228879\",\"attributes\":{\"tags\":[\"TestRubyDeleteatagconfigurationreturnsNoContentresponse1619228879\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:47:59.465861+00:00\",\"modified_at\":\"2021-04-24T01:47:59.465861+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyUpdateatagconfigurationreturnsOKresponse1619228888\",\"attributes\":{\"tags\":[\"TestRubyUpdateatagconfigurationreturnsOKresponse1619228888\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:48:08.955735+00:00\",\"modified_at\":\"2021-04-24T01:48:08.955735+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619228879\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619228879\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:47:59.924705+00:00\",\"modified_at\":\"2021-04-24T01:47:59.924705+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1619228880\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1619228880\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:48:00.601042+00:00\",\"modified_at\":\"2021-04-24T01:48:00.601042+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagsbymetricnamereturnsSuccessresponse1619228888\",\"attributes\":{\"tags\":[\"TestRubyListtagsbymetricnamereturnsSuccessresponse1619228888\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:48:08.489900+00:00\",\"modified_at\":\"2021-04-24T01:48:08.489900+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonCreateatagconfigurationreturnsCreatedresponse1619421459\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-26T07:17:40.163589+00:00\",\"modified_at\":\"2021-04-26T07:17:40.163589+00:00\",\"metric_type\":\"distribution\"}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 625, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-01T11:59:49.595Z", + "time": 2407 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Metrics_2046978582/List-active-tags-and-aggregations-returns-Success-response_688693587/frozen.json b/cassettes/v2/Metrics_2046978582/List-active-tags-and-aggregations-returns-Success-response_688693587/frozen.json new file mode 100644 index 000000000000..8f47c8d404e0 --- /dev/null +++ b/cassettes/v2/Metrics_2046978582/List-active-tags-and-aggregations-returns-Success-response_688693587/frozen.json @@ -0,0 +1 @@ +"2022-09-01T12:00:27.800Z" diff --git a/cassettes/v2/Metrics_2046978582/List-active-tags-and-aggregations-returns-Success-response_688693587/recording.har b/cassettes/v2/Metrics_2046978582/List-active-tags-and-aggregations-returns-Success-response_688693587/recording.har new file mode 100644 index 000000000000..ff9e81219930 --- /dev/null +++ b/cassettes/v2/Metrics_2046978582/List-active-tags-and-aggregations-returns-Success-response_688693587/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Metrics/List active tags and aggregations returns \"Success\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "c82655d4212a549a617948c07bf872be", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 201, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "text/json, application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "text/json" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "text/json", + "params": [], + "text": "{\"series\":[{\"metric\":\"TestListactivetagsandaggregationsreturnsSuccessresponse1662033627\",\"points\":[[1662033627,1.1]],\"tags\":[\"test:ExampleSubmitmetricsreturnsPayloadacceptedresponse\"],\"type\":\"gauge\"}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/series" + }, + "response": { + "bodySize": 16, + "content": { + "mimeType": "text/json", + "size": 16, + "text": "{\"status\": \"ok\"}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/json" + } + ], + "headersSize": 459, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 202, + "statusText": "Accepted" + }, + "startedDateTime": "2022-09-01T12:00:27.809Z", + "time": 372 + }, + { + "_id": "c1548ccf8c41122eee7a7ebae9840749", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 606, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/metrics/TestListactivetagsandaggregationsreturnsSuccessresponse1662033627/active-configurations" + }, + "response": { + "bodySize": 182, + "content": { + "mimeType": "application/json", + "size": 182, + "text": "{\"data\":{\"type\":\"actively_queried_configurations\",\"id\":\"TestListactivetagsandaggregationsreturnsSuccessresponse1662033627\",\"attributes\":{\"active_tags\":[],\"active_aggregations\":[]}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 630, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-01T12:00:28.198Z", + "time": 674 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/metrics/ListActiveMetricConfigurations.ts b/examples/v2/metrics/ListActiveMetricConfigurations.ts new file mode 100644 index 000000000000..f333413abebd --- /dev/null +++ b/examples/v2/metrics/ListActiveMetricConfigurations.ts @@ -0,0 +1,21 @@ +/** + * List active tags and aggregations returns "Success" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.MetricsApi(configuration); + +const params: v2.MetricsApiListActiveMetricConfigurationsRequest = { + metricName: "ExampleListactivetagsandaggregationsreturnsSuccessresponse", +}; + +apiInstance + .listActiveMetricConfigurations(params) + .then((data: v2.MetricSuggestedTagsAndAggregationsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/metrics/ListTagConfigurations.ts b/examples/v2/metrics/ListTagConfigurations.ts index 32363f2ba12f..3af2dbb1843a 100644 --- a/examples/v2/metrics/ListTagConfigurations.ts +++ b/examples/v2/metrics/ListTagConfigurations.ts @@ -1,5 +1,5 @@ /** - * List tag configurations returns "Success" response + * Get a list of metrics returns "Success" response */ import { client, v2 } from "@datadog/datadog-api-client"; diff --git a/examples/v2/metrics/ListTagConfigurations_1799362914.ts b/examples/v2/metrics/ListTagConfigurations_265033704.ts similarity index 75% rename from examples/v2/metrics/ListTagConfigurations_1799362914.ts rename to examples/v2/metrics/ListTagConfigurations_265033704.ts index eefeaab57e98..421a233e52a8 100644 --- a/examples/v2/metrics/ListTagConfigurations_1799362914.ts +++ b/examples/v2/metrics/ListTagConfigurations_265033704.ts @@ -1,5 +1,5 @@ /** - * List tag configurations with a tag filter returns "Success" response + * Get a list of metrics with a tag filter returns "Success" response */ import { client, v2 } from "@datadog/datadog-api-client"; @@ -8,8 +8,7 @@ const configuration = client.createConfiguration(); const apiInstance = new v2.MetricsApi(configuration); const params: v2.MetricsApiListTagConfigurationsRequest = { - filterTags: - "ExampleListtagconfigurationswithatagfilterreturnsSuccessresponse", + filterTags: "ExampleGetalistofmetricswithatagfilterreturnsSuccessresponse", }; apiInstance diff --git a/examples/v2/metrics/ListTagConfigurations_103226315.ts b/examples/v2/metrics/ListTagConfigurations_2739018321.ts similarity index 87% rename from examples/v2/metrics/ListTagConfigurations_103226315.ts rename to examples/v2/metrics/ListTagConfigurations_2739018321.ts index d7a7122c88e4..5cc78d1a6249 100644 --- a/examples/v2/metrics/ListTagConfigurations_103226315.ts +++ b/examples/v2/metrics/ListTagConfigurations_2739018321.ts @@ -1,5 +1,5 @@ /** - * List tag configurations with configured filter returns "Success" response + * Get a list of metrics with configured filter returns "Success" response */ import { client, v2 } from "@datadog/datadog-api-client"; diff --git a/features/v2/metrics.feature b/features/v2/metrics.feature index 48f43ab4d55b..0d46ae6b31f7 100644 --- a/features/v2/metrics.feature +++ b/features/v2/metrics.feature @@ -84,6 +84,63 @@ Feature: Metrics When the request is sent Then the response status is 404 Not found + @generated @skip @team:DataDog/points-aggregation + Scenario: Get a list of metrics returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "ListTagConfigurations" request + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/points-aggregation + Scenario: Get a list of metrics returns "Success" response + Given a valid "appKeyAuth" key in the system + And there is a valid "metric_tag_configuration" in the system + And new "ListTagConfigurations" request + When the request is sent + Then the response status is 200 Success + + @team:DataDog/points-aggregation + Scenario: Get a list of metrics with a tag filter returns "Success" response + Given a valid "appKeyAuth" key in the system + And new "ListTagConfigurations" request + And request contains "filter[tags]" parameter with value "{{ unique_alnum }}" + When the request is sent + Then the response status is 200 Success + + @team:DataDog/points-aggregation + Scenario: Get a list of metrics with configured filter returns "Success" response + Given a valid "appKeyAuth" key in the system + And new "ListTagConfigurations" request + And request contains "filter[configured]" parameter with value true + When the request is sent + Then the response status is 200 Success + + @generated @skip @team:DataDog/points-aggregation + Scenario: List active tags and aggregations returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And new "ListActiveMetricConfigurations" request + And request contains "metric_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/points-aggregation + Scenario: List active tags and aggregations returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And new "ListActiveMetricConfigurations" request + And request contains "metric_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/points-aggregation + Scenario: List active tags and aggregations returns "Success" response + Given a valid "appKeyAuth" key in the system + And there is a valid "metric" in the system + And new "ListActiveMetricConfigurations" request + And request contains "metric_name" parameter with value "{{ unique_alnum }}" + When the request is sent + Then the response status is 200 Success + And the response "data.type" is equal to "actively_queried_configurations" + @generated @skip @team:DataDog/points-aggregation Scenario: List distinct metric volumes by metric name returns "Bad Request" response Given a valid "appKeyAuth" key in the system @@ -130,37 +187,6 @@ Feature: Metrics Then the response status is 200 Success And the response "data.id" has the same value as "metric_tag_configuration.data.id" - @generated @skip @team:DataDog/points-aggregation - Scenario: List tag configurations returns "Bad Request" response - Given a valid "appKeyAuth" key in the system - And new "ListTagConfigurations" request - When the request is sent - Then the response status is 400 Bad Request - - @skip @team:DataDog/points-aggregation - Scenario: List tag configurations returns "Success" response - Given a valid "appKeyAuth" key in the system - And there is a valid "metric_tag_configuration" in the system - And new "ListTagConfigurations" request - When the request is sent - Then the response status is 200 Success - - @team:DataDog/points-aggregation - Scenario: List tag configurations with a tag filter returns "Success" response - Given a valid "appKeyAuth" key in the system - And new "ListTagConfigurations" request - And request contains "filter[tags]" parameter with value "{{ unique_alnum }}" - When the request is sent - Then the response status is 200 Success - - @team:DataDog/points-aggregation - Scenario: List tag configurations with configured filter returns "Success" response - Given a valid "appKeyAuth" key in the system - And new "ListTagConfigurations" request - And request contains "filter[configured]" parameter with value true - When the request is sent - Then the response status is 200 Success - @generated @skip @team:DataDog/points-aggregation Scenario: List tags by metric name returns "Bad Request" response Given a valid "appKeyAuth" key in the system diff --git a/features/v2/undo.json b/features/v2/undo.json index 936716051f5d..97b84af6f7dd 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -409,6 +409,12 @@ "type": "unsafe" } }, + "ListActiveMetricConfigurations": { + "tag": "Metrics", + "undo": { + "type": "safe" + } + }, "ListTagsByMetricName": { "tag": "Metrics", "undo": { diff --git a/packages/datadog-api-client-v2/apis/MetricsApi.ts b/packages/datadog-api-client-v2/apis/MetricsApi.ts index b5848dfadb6d..10d58a622a59 100644 --- a/packages/datadog-api-client-v2/apis/MetricsApi.ts +++ b/packages/datadog-api-client-v2/apis/MetricsApi.ts @@ -27,6 +27,7 @@ import { MetricContentEncoding } from "../models/MetricContentEncoding"; import { MetricEstimateResponse } from "../models/MetricEstimateResponse"; import { MetricPayload } from "../models/MetricPayload"; import { MetricsAndMetricTagConfigurationsResponse } from "../models/MetricsAndMetricTagConfigurationsResponse"; +import { MetricSuggestedTagsAndAggregationsResponse } from "../models/MetricSuggestedTagsAndAggregationsResponse"; import { MetricTagConfigurationCreateRequest } from "../models/MetricTagConfigurationCreateRequest"; import { MetricTagConfigurationMetricTypes } from "../models/MetricTagConfigurationMetricTypes"; import { MetricTagConfigurationResponse } from "../models/MetricTagConfigurationResponse"; @@ -291,6 +292,53 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listActiveMetricConfigurations( + metricName: string, + windowSeconds?: number, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'metricName' is not null or undefined + if (metricName === null || metricName === undefined) { + throw new RequiredError( + "Required parameter metricName was null or undefined when calling listActiveMetricConfigurations." + ); + } + + // Path Params + const localVarPath = + "/api/v2/metrics/{metric_name}/active-configurations".replace( + "{" + "metric_name" + "}", + encodeURIComponent(String(metricName)) + ); + + // Make Request Context + const requestContext = getServer( + _config, + "v2.MetricsApi.listActiveMetricConfigurations" + ).makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (windowSeconds !== undefined) { + requestContext.setQueryParam( + "window[seconds]", + ObjectSerializer.serialize(windowSeconds, "number", "int64") + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listTagConfigurationByName( metricName: string, _options?: Configuration @@ -333,6 +381,7 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory { filterTagsConfigured?: string, filterMetricType?: MetricTagConfigurationMetricTypes, filterIncludePercentiles?: boolean, + filterQueried?: boolean, filterTags?: string, windowSeconds?: number, _options?: Configuration @@ -379,6 +428,12 @@ export class MetricsApiRequestFactory extends BaseAPIRequestFactory { ObjectSerializer.serialize(filterIncludePercentiles, "boolean", "") ); } + if (filterQueried !== undefined) { + requestContext.setQueryParam( + "filter[queried]", + ObjectSerializer.serialize(filterQueried, "boolean", "") + ); + } if (filterTags !== undefined) { requestContext.setQueryParam( "filter[tags]", @@ -929,6 +984,79 @@ export class MetricsApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listActiveMetricConfigurations + * @throws ApiException if the response code was not in [200, 299] + */ + public async listActiveMetricConfigurations( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (isCodeInRange("200", response.httpStatusCode)) { + const body: MetricSuggestedTagsAndAggregationsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MetricSuggestedTagsAndAggregationsResponse", + "" + ) as MetricSuggestedTagsAndAggregationsResponse; + return body; + } + if (isCodeInRange("400", response.httpStatusCode)) { + const body: APIErrorResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "APIErrorResponse", + "" + ) as APIErrorResponse; + throw new ApiException(400, body); + } + if (isCodeInRange("403", response.httpStatusCode)) { + const body: APIErrorResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "APIErrorResponse", + "" + ) as APIErrorResponse; + throw new ApiException(403, body); + } + if (isCodeInRange("404", response.httpStatusCode)) { + const body: APIErrorResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "APIErrorResponse", + "" + ) as APIErrorResponse; + throw new ApiException(404, body); + } + if (isCodeInRange("429", response.httpStatusCode)) { + const body: APIErrorResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "APIErrorResponse", + "" + ) as APIErrorResponse; + throw new ApiException(429, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: MetricSuggestedTagsAndAggregationsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "MetricSuggestedTagsAndAggregationsResponse", + "" + ) as MetricSuggestedTagsAndAggregationsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1417,6 +1545,20 @@ export interface MetricsApiEstimateMetricsOutputSeriesRequest { filterTimespanH?: number; } +export interface MetricsApiListActiveMetricConfigurationsRequest { + /** + * The name of the metric. + * @type string + */ + metricName: string; + /** + * The number of seconds of look back (from now). + * Default value is 604,800 (1 week), minimum value is 7200 (2 hours), maximum value is 2,630,000 (1 month). + * @type number + */ + windowSeconds?: number; +} + export interface MetricsApiListTagConfigurationByNameRequest { /** * The name of the metric. @@ -1427,7 +1569,7 @@ export interface MetricsApiListTagConfigurationByNameRequest { export interface MetricsApiListTagConfigurationsRequest { /** - * Filter metrics that have configured tags. + * Filter custom metrics that have configured tags. * @type boolean */ filterConfigured?: boolean; @@ -1437,7 +1579,7 @@ export interface MetricsApiListTagConfigurationsRequest { */ filterTagsConfigured?: string; /** - * Filter tag configurations by metric type. + * Filter metrics by metric type. * @type MetricTagConfigurationMetricTypes */ filterMetricType?: MetricTagConfigurationMetricTypes; @@ -1447,15 +1589,21 @@ export interface MetricsApiListTagConfigurationsRequest { * @type boolean */ filterIncludePercentiles?: boolean; + /** + * Filter custom metrics that have or have not been queried in the specified window[seconds]. + * If no window is provided or the window is less than 2 hours, a default of 2 hours will be applied. + * @type boolean + */ + filterQueried?: boolean; /** * Filter metrics that have been submitted with the given tags. Supports boolean and wildcard expressions. - * Cannot be combined with other filters. + * Can only be combined with the filter[queried] filter. * @type string */ filterTags?: string; /** - * The number of seconds of look back (from now) to apply to a filter[tag] query. - * Defaults value is 3600 (1 hour), maximum value is 172,800 (2 days). + * The number of seconds of look back (from now) to apply to a filter[tag] or filter[queried] query. + * Defaults value is 3600 (1 hour), maximum value is 1,209,600 (2 weeks). * @type number */ windowSeconds?: number; @@ -1650,6 +1798,31 @@ export class MetricsApi { }); } + /** + * List tags and aggregations that are actively queried on dashboards and monitors for a given metric name. + * @param param The request object + */ + public listActiveMetricConfigurations( + param: MetricsApiListActiveMetricConfigurationsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listActiveMetricConfigurations( + param.metricName, + param.windowSeconds, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listActiveMetricConfigurations( + responseContext + ); + }); + }); + } + /** * Returns the tag configuration for the given metric name. * @param param The request object @@ -1672,8 +1845,7 @@ export class MetricsApi { } /** - * Returns all configured count/gauge/rate/distribution metric names - * (with additional filters if specified). + * Returns all metrics (matching additional filters if specified). * @param param The request object */ public listTagConfigurations( @@ -1685,6 +1857,7 @@ export class MetricsApi { param.filterTagsConfigured, param.filterMetricType, param.filterIncludePercentiles, + param.filterQueried, param.filterTags, param.windowSeconds, options diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 7be1dda1b97a..eb5325ded652 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -114,6 +114,7 @@ export { MetricsApiDeleteBulkTagsMetricsConfigurationRequest, MetricsApiDeleteTagConfigurationRequest, MetricsApiEstimateMetricsOutputSeriesRequest, + MetricsApiListActiveMetricConfigurationsRequest, MetricsApiListTagConfigurationByNameRequest, MetricsApiListTagConfigurationsRequest, MetricsApiListTagsByMetricNameRequest, @@ -468,6 +469,7 @@ export { LogsSortOrder } from "./models/LogsSortOrder"; export { LogsWarning } from "./models/LogsWarning"; export { LogType } from "./models/LogType"; export { Metric } from "./models/Metric"; +export { MetricActiveConfigurationType } from "./models/MetricActiveConfigurationType"; export { MetricAllTags } from "./models/MetricAllTags"; export { MetricAllTagsAttributes } from "./models/MetricAllTagsAttributes"; export { MetricAllTagsResponse } from "./models/MetricAllTagsResponse"; @@ -505,6 +507,9 @@ export { MetricResource } from "./models/MetricResource"; export { MetricsAndMetricTagConfigurations } from "./models/MetricsAndMetricTagConfigurations"; export { MetricsAndMetricTagConfigurationsResponse } from "./models/MetricsAndMetricTagConfigurationsResponse"; export { MetricSeries } from "./models/MetricSeries"; +export { MetricSuggestedTagsAndAggregations } from "./models/MetricSuggestedTagsAndAggregations"; +export { MetricSuggestedTagsAndAggregationsResponse } from "./models/MetricSuggestedTagsAndAggregationsResponse"; +export { MetricSuggestedTagsAttributes } from "./models/MetricSuggestedTagsAttributes"; export { MetricTagConfiguration } from "./models/MetricTagConfiguration"; export { MetricTagConfigurationAttributes } from "./models/MetricTagConfigurationAttributes"; export { MetricTagConfigurationCreateAttributes } from "./models/MetricTagConfigurationCreateAttributes"; diff --git a/packages/datadog-api-client-v2/models/MetricActiveConfigurationType.ts b/packages/datadog-api-client-v2/models/MetricActiveConfigurationType.ts new file mode 100644 index 000000000000..224248edf010 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MetricActiveConfigurationType.ts @@ -0,0 +1,10 @@ +/** + * 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. + */ + +export type MetricActiveConfigurationType = + typeof ACTIVELY_QUERIED_CONFIGURATIONS; +export const ACTIVELY_QUERIED_CONFIGURATIONS = + "actively_queried_configurations"; diff --git a/packages/datadog-api-client-v2/models/MetricSuggestedTagsAndAggregations.ts b/packages/datadog-api-client-v2/models/MetricSuggestedTagsAndAggregations.ts new file mode 100644 index 000000000000..47164e3324ee --- /dev/null +++ b/packages/datadog-api-client-v2/models/MetricSuggestedTagsAndAggregations.ts @@ -0,0 +1,59 @@ +/** + * 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. + */ +import { MetricActiveConfigurationType } from "./MetricActiveConfigurationType"; +import { MetricSuggestedTagsAttributes } from "./MetricSuggestedTagsAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object for a single metric's actively queried tags and aggregations. + */ +export class MetricSuggestedTagsAndAggregations { + /** + * Object containing the definition of a metric's actively queried tags and aggregations. + */ + "attributes"?: MetricSuggestedTagsAttributes; + /** + * The metric name for this resource. + */ + "id"?: string; + /** + * The metric actively queried configuration resource type. + */ + "type"?: MetricActiveConfigurationType; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "MetricSuggestedTagsAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "MetricActiveConfigurationType", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MetricSuggestedTagsAndAggregations.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MetricSuggestedTagsAndAggregationsResponse.ts b/packages/datadog-api-client-v2/models/MetricSuggestedTagsAndAggregationsResponse.ts new file mode 100644 index 000000000000..8cacfd63e165 --- /dev/null +++ b/packages/datadog-api-client-v2/models/MetricSuggestedTagsAndAggregationsResponse.ts @@ -0,0 +1,42 @@ +/** + * 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. + */ +import { MetricSuggestedTagsAndAggregations } from "./MetricSuggestedTagsAndAggregations"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response object that includes a single metric's actively queried tags and aggregations. + */ +export class MetricSuggestedTagsAndAggregationsResponse { + /** + * Object for a single metric's actively queried tags and aggregations. + */ + "data"?: MetricSuggestedTagsAndAggregations; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "MetricSuggestedTagsAndAggregations", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MetricSuggestedTagsAndAggregationsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/MetricSuggestedTagsAttributes.ts b/packages/datadog-api-client-v2/models/MetricSuggestedTagsAttributes.ts new file mode 100644 index 000000000000..d7081d717eaa --- /dev/null +++ b/packages/datadog-api-client-v2/models/MetricSuggestedTagsAttributes.ts @@ -0,0 +1,50 @@ +/** + * 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. + */ +import { MetricCustomAggregation } from "./MetricCustomAggregation"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object containing the definition of a metric's actively queried tags and aggregations. + */ +export class MetricSuggestedTagsAttributes { + /** + * List of aggregation combinations that have been actively queried. + */ + "activeAggregations"?: Array; + /** + * List of tag keys that have been actively queried. + */ + "activeTags"?: Array; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + activeAggregations: { + baseName: "active_aggregations", + type: "Array", + }, + activeTags: { + baseName: "active_tags", + type: "Array", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return MetricSuggestedTagsAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 0cf58e5de6bf..84dfefd4039d 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -218,6 +218,9 @@ import { MetricPayload } from "./MetricPayload"; import { MetricPoint } from "./MetricPoint"; import { MetricResource } from "./MetricResource"; import { MetricSeries } from "./MetricSeries"; +import { MetricSuggestedTagsAndAggregations } from "./MetricSuggestedTagsAndAggregations"; +import { MetricSuggestedTagsAndAggregationsResponse } from "./MetricSuggestedTagsAndAggregationsResponse"; +import { MetricSuggestedTagsAttributes } from "./MetricSuggestedTagsAttributes"; import { MetricTagConfiguration } from "./MetricTagConfiguration"; import { MetricTagConfigurationAttributes } from "./MetricTagConfigurationAttributes"; import { MetricTagConfigurationCreateAttributes } from "./MetricTagConfigurationCreateAttributes"; @@ -535,6 +538,7 @@ const enumsMap: { [key: string]: any[] } = { LogsMetricType: ["logs_metrics"], LogsSort: ["timestamp", "-timestamp"], LogsSortOrder: ["asc", "desc"], + MetricActiveConfigurationType: ["actively_queried_configurations"], MetricBulkConfigureTagsType: ["metric_bulk_configure_tags"], MetricContentEncoding: ["deflate", "zstd1", "gzip"], MetricCustomSpaceAggregation: ["avg", "max", "min", "sum"], @@ -878,6 +882,10 @@ const typeMap: { [index: string]: any } = { MetricPoint: MetricPoint, MetricResource: MetricResource, MetricSeries: MetricSeries, + MetricSuggestedTagsAndAggregations: MetricSuggestedTagsAndAggregations, + MetricSuggestedTagsAndAggregationsResponse: + MetricSuggestedTagsAndAggregationsResponse, + MetricSuggestedTagsAttributes: MetricSuggestedTagsAttributes, MetricTagConfiguration: MetricTagConfiguration, MetricTagConfigurationAttributes: MetricTagConfigurationAttributes, MetricTagConfigurationCreateAttributes: From 8386fd45fbcac4e130e356a543a49953ff4504b0 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, 6 Sep 2022 14:00:51 +0000 Subject: [PATCH 05/30] Regenerate client from commit 8c9d402b of spec repo (#826) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 ++++---- .generator/schemas/v1/openapi.yaml | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 02f5923ec903..95de56c96248 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-02 12:49:58.211262", - "spec_repo_commit": "3aa1b866" + "regenerated": "2022-09-06 13:52:54.288578", + "spec_repo_commit": "8c9d402b" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-02 12:49:58.223954", - "spec_repo_commit": "3aa1b866" + "regenerated": "2022-09-06 13:52:54.301475", + "spec_repo_commit": "8c9d402b" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 3fe196d7d007..45bdd63bf251 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -5646,6 +5646,9 @@ components: type: string pointlist: description: List of points of the time series. + example: + - - 1575317847.0 + - 0.5 items: $ref: '#/components/schemas/Point' readOnly: true From 6e95b74431179a3eafa24cb61e08d42d1a74bf99 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 07:25:23 +0000 Subject: [PATCH 06/30] Remove duplicate test files (#829) * remove duplicate * Regenerate client from commit 36a61042 of spec repo Co-authored-by: Sherzod Karimov Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 +-- .../frozen.json | 1 - .../recording.har | 64 ------------------- .../frozen.json | 1 - .../recording.har | 64 ------------------- 5 files changed, 4 insertions(+), 134 deletions(-) delete mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/frozen.json delete mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/recording.har delete mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/frozen.json delete mode 100644 cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/recording.har diff --git a/.apigentools-info b/.apigentools-info index 95de56c96248..746895e59aae 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-06 13:52:54.288578", - "spec_repo_commit": "8c9d402b" + "regenerated": "2022-09-06 20:46:59.630821", + "spec_repo_commit": "36a61042" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-06 13:52:54.301475", - "spec_repo_commit": "8c9d402b" + "regenerated": "2022-09-06 20:46:59.643602", + "spec_repo_commit": "36a61042" } } } \ No newline at end of file diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/frozen.json b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/frozen.json deleted file mode 100644 index daa985758474..000000000000 --- a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/frozen.json +++ /dev/null @@ -1 +0,0 @@ -"2022-08-05T07:10:54.386Z" diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/recording.har b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/recording.har deleted file mode 100644 index 8e5806e5cfc8..000000000000 --- a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-a-tag-filter-returns-Success-response_2975113796/recording.har +++ /dev/null @@ -1,64 +0,0 @@ -{ - "log": { - "_recordingName": "Metrics/Get a list of Metrics with a tag filter returns \"Success\" response", - "creator": { - "comment": "persister:fs", - "name": "Polly.JS", - "version": "6.0.5" - }, - "entries": [ - { - "_id": "58cad22be78c362f8c820fd9232233aa", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 0, - "cookies": [], - "headers": [ - { - "_fromType": "array", - "name": "accept", - "value": "application/json" - } - ], - "headersSize": 594, - "httpVersion": "HTTP/1.1", - "method": "GET", - "queryString": [ - { - "name": "filter", - "value": { - "tags": "TestGetalistofMetricswithatagfilterreturnsSuccessresponse1659683454" - } - } - ], - "url": "https://api.datadoghq.com/api/v2/metrics?filter%5Btags%5D=TestGetalistofMetricswithatagfilterreturnsSuccessresponse1659683454" - }, - "response": { - "bodySize": 12, - "content": { - "mimeType": "application/json", - "size": 12, - "text": "{\"data\":[]}\n" - }, - "cookies": [], - "headers": [ - { - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 599, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 200, - "statusText": "OK" - }, - "startedDateTime": "2022-08-05T07:10:54.408Z", - "time": 609 - } - ], - "pages": [], - "version": "1.2" - } -} diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/frozen.json b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/frozen.json deleted file mode 100644 index 260f4f64522a..000000000000 --- a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/frozen.json +++ /dev/null @@ -1 +0,0 @@ -"2022-08-05T07:10:55.036Z" diff --git a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/recording.har b/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/recording.har deleted file mode 100644 index 6d0712fd82ed..000000000000 --- a/cassettes/v2/Metrics_2046978582/Get-a-list-of-Metrics-with-configured-filter-returns-Success-response_4211947499/recording.har +++ /dev/null @@ -1,64 +0,0 @@ -{ - "log": { - "_recordingName": "Metrics/Get a list of Metrics with configured filter returns \"Success\" response", - "creator": { - "comment": "persister:fs", - "name": "Polly.JS", - "version": "6.0.5" - }, - "entries": [ - { - "_id": "6a6c3737116332b63162f7d3bcb05a06", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 0, - "cookies": [], - "headers": [ - { - "_fromType": "array", - "name": "accept", - "value": "application/json" - } - ], - "headersSize": 536, - "httpVersion": "HTTP/1.1", - "method": "GET", - "queryString": [ - { - "name": "filter", - "value": { - "configured": "true" - } - } - ], - "url": "https://api.datadoghq.com/api/v2/metrics?filter%5Bconfigured%5D=true" - }, - "response": { - "bodySize": 61346, - "content": { - "mimeType": "application/json", - "size": 61346, - "text": "{\"data\":[{\"type\":\"manage_tags\",\"id\":\"test.metric.1\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"created_at\":\"2022-03-24T18:23:55.957002+00:00\",\"modified_at\":\"2022-03-28T14:34:32.618807+00:00\",\"metric_type\":\"gauge\",\"aggregations\":[{\"space\":\"avg\",\"time\":\"avg\"}]}},{\"type\":\"manage_tags\",\"id\":\"foo\",\"attributes\":{\"tags\":[\"datacenter\",\"sport\"],\"created_at\":\"2021-10-27T12:35:56.242671+00:00\",\"modified_at\":\"2021-10-27T12:41:22.413540+00:00\",\"metric_type\":\"count\",\"aggregations\":[{\"space\":\"sum\",\"time\":\"sum\"}]}},{\"type\":\"manage_tags\",\"id\":\"ExampleListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1653177320\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"ExampleListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1653177320\"],\"created_at\":\"2022-05-21T23:55:28.435000+00:00\",\"modified_at\":\"2022-05-21T23:55:28.435000+00:00\",\"metric_type\":\"gauge\",\"aggregations\":[{\"space\":\"avg\",\"time\":\"avg\"}]}},{\"type\":\"manage_tags\",\"id\":\"javaCreateatagconfigu1617241053\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:34.078032+00:00\",\"modified_at\":\"2021-05-07T09:02:37.581544+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1616498653\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:13.435931+00:00\",\"modified_at\":\"2021-03-23T11:24:13.435931+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagsbymetricnamereturnsSuccessresponse1618241083\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListtagsbymetricnamereturnsSuccessresponse1618241083\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T15:24:43.937851+00:00\",\"modified_at\":\"2021-04-12T15:24:43.937851+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioCreateaTagConfigurationreturnsCreatedresponse462771613138431\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.059033+00:00\",\"modified_at\":\"2021-02-12T14:00:32.059033+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioDeleteaTagConfigurationreturnsNoContentresponse462771613138432\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioDeleteaTagConfigurationreturnsNoContentresponse462771613138432\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.286794+00:00\",\"modified_at\":\"2021-02-12T14:00:32.286794+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse462771613138432\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse462771613138432\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.668585+00:00\",\"modified_at\":\"2021-02-12T14:00:32.668585+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListTagConfigurationsreturnsSuccessresponse462771613138432\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListTagConfigurationsreturnsSuccessresponse462771613138432\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:32.953685+00:00\",\"modified_at\":\"2021-02-12T14:00:32.953685+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateaTagConfigurationreturnsOKresponse462771613138437\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateaTagConfigurationreturnsOKresponse462771613138437\"],\"include_percentiles\":false,\"created_at\":\"2021-02-12T14:00:37.707422+00:00\",\"modified_at\":\"2021-02-12T14:00:37.707422+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1613308647656458\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-14T13:17:28.200159+00:00\",\"modified_at\":\"2021-02-14T13:17:28.200159+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaDeleteaTagConfigu1613601517\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaDeleteaTagConfigu1613601517\"],\"include_percentiles\":false,\"created_at\":\"2021-02-17T22:38:38.226434+00:00\",\"modified_at\":\"2021-02-17T22:38:38.226434+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613674911438\",\"attributes\":{\"tags\":[\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613674911438\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:51.701561+00:00\",\"modified_at\":\"2021-02-18T19:01:51.701561+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateaTagConfigurationreturnsCreatedresponse1613674910068\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:50.346751+00:00\",\"modified_at\":\"2021-02-18T19:01:50.346751+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationsreturnsSuccessresponse1613674912224\",\"attributes\":{\"tags\":[\"TypescriptListTagConfigurationsreturnsSuccessresponse1613674912224\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:52.489744+00:00\",\"modified_at\":\"2021-02-18T19:01:52.489744+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateaTagConfigurationreturnsOKresponse1613674918621\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:01:58.909298+00:00\",\"modified_at\":\"2021-02-18T19:01:59.239616+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateaTagConfigurationreturnsCreatedresponse1613675388888\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:49.157042+00:00\",\"modified_at\":\"2021-02-18T19:09:49.157042+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateaTagConfigurationreturnsOKresponse1613675398177\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:58.429942+00:00\",\"modified_at\":\"2021-02-18T19:09:58.778902+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationsreturnsSuccessresponse1613675391059\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListTagConfigurationsreturnsSuccessresponse1613675391059\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:51.329650+00:00\",\"modified_at\":\"2021-02-18T19:09:51.329650+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613675390193\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListTagConfigurationbyNamereturnsSuccessresponse1613675390193\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:09:50.468784+00:00\",\"modified_at\":\"2021-02-18T19:09:50.468784+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteaTagConfigurationreturnsNoContentresponse1613676227224\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptDeleteaTagConfigurationreturnsNoContentresponse1613676227224\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-18T19:23:47.510239+00:00\",\"modified_at\":\"2021-02-18T19:23:47.510239+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1613983335\",\"attributes\":{\"tags\":[\"javaUpdateaTagConfigu1613983335\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-22T08:42:15.339339+00:00\",\"modified_at\":\"2021-02-22T08:42:15.339339+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1613983337447904\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1613983337447904\"],\"include_percentiles\":false,\"created_at\":\"2021-02-22T08:42:17.877627+00:00\",\"modified_at\":\"2021-02-22T08:42:17.877627+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateaTagConfigurationreturnsCreatedresponse1613983377189\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-22T08:42:57.496771+00:00\",\"modified_at\":\"2021-02-22T08:42:57.496771+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse489431614557161\",\"attributes\":{\"tags\":[\"goFeatureMetricsScenarioListTagConfigurationbyNamereturnsSuccessresponse489431614557161\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-01T00:06:01.798862+00:00\",\"modified_at\":\"2021-03-01T00:06:01.798862+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1614290498\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateaTagConfigu1614290498\"],\"include_percentiles\":false,\"created_at\":\"2021-02-25T22:01:38.735081+00:00\",\"modified_at\":\"2021-02-25T22:01:38.735081+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1614648774\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateaTagConfigu1614648774\"],\"include_percentiles\":false,\"created_at\":\"2021-03-02T01:32:55.019781+00:00\",\"modified_at\":\"2021-03-02T01:32:55.019781+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1612987674596336\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1612987674596336\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:54.979797+00:00\",\"modified_at\":\"2021-03-03T22:28:32.386290+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1612987679233002\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:59.516348+00:00\",\"modified_at\":\"2021-03-03T20:42:09.521631+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagconfigurationsreturnssuccessresponse1612987675260358\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagconfigurationsreturnssuccessresponse1612987675260358\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:55.559669+00:00\",\"modified_at\":\"2021-03-03T20:45:46.030871+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateaTagConfigurationreturnsOKresponse1614821029942\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptUpdateaTagConfigurationreturnsOKresponse1614821029942\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T01:23:50.307273+00:00\",\"modified_at\":\"2021-03-04T01:23:50.307273+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1614632066664577\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1614632066664577\"],\"include_percentiles\":false,\"created_at\":\"2021-03-01T20:54:26.950587+00:00\",\"modified_at\":\"2021-03-03T19:53:57.601421+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1612987678724128\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1612987678724128\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:59.011905+00:00\",\"modified_at\":\"2021-03-03T19:54:03.012021+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateaTagConfigu1614907949\",\"attributes\":{\"tags\":[\"javaUpdateaTagConfigu1614907949\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:29.891018+00:00\",\"modified_at\":\"2021-03-05T01:32:29.891018+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListTagConfigurati1614907942\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListTagConfigurati1614907942\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:22.257630+00:00\",\"modified_at\":\"2021-03-05T01:32:22.779595+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaCreateaTagConfigu1614907941\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:21.472249+00:00\",\"modified_at\":\"2021-03-05T01:32:21.472249+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaDeleteaTagConfigu1614907941\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaDeleteaTagConfigu1614907941\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T01:32:21.840312+00:00\",\"modified_at\":\"2021-03-05T01:32:21.840312+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1614877824877072\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1614877824877072\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T17:10:25.408162+00:00\",\"modified_at\":\"2021-03-04T18:03:35.564866+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse161487782309652\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse161487782309652\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T17:10:23.841708+00:00\",\"modified_at\":\"2021-03-04T18:03:25.853564+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1614878558721298\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1614878558721298\"],\"include_percentiles\":false,\"created_at\":\"2021-03-04T17:22:39.122261+00:00\",\"modified_at\":\"2021-03-04T18:03:33.352006+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1612987679647768\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1612987679647768\"],\"include_percentiles\":false,\"created_at\":\"2021-02-10T20:07:59.946457+00:00\",\"modified_at\":\"2021-03-04T09:39:37.370474+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1614962335\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1614962335\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T16:38:55.946186+00:00\",\"modified_at\":\"2021-03-05T16:38:55.946186+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateatagconfigu1614962336\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateatagconfigu1614962336\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T16:38:56.440191+00:00\",\"modified_at\":\"2021-03-05T16:38:56.440191+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1614984109\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1614984109\"],\"include_percentiles\":false,\"created_at\":\"2021-03-05T22:41:50.029868+00:00\",\"modified_at\":\"2021-03-05T22:41:50.029868+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse505431615205163\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse505431615205163\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T12:06:03.965736+00:00\",\"modified_at\":\"2021-03-08T12:06:03.965736+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaCreateatagconfigu1615195320\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:00.581891+00:00\",\"modified_at\":\"2021-03-08T09:22:00.581891+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListdistinctmetric1615195322\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListdistinctmetric1615195322\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:02.640568+00:00\",\"modified_at\":\"2021-03-08T09:22:02.640568+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaDeleteatagconfigu1615195321\",\"attributes\":{\"tags\":[\"javaDeleteatagconfigu1615195321\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:01.374349+00:00\",\"modified_at\":\"2021-03-08T09:22:01.374349+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1615195323\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagconfigurati1615195323\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:03.733804+00:00\",\"modified_at\":\"2021-03-08T09:22:03.733804+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1615195324\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagconfigurati1615195324\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:04.847552+00:00\",\"modified_at\":\"2021-03-08T09:22:04.847552+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1615195329\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1615195329\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:10.192146+00:00\",\"modified_at\":\"2021-03-08T09:22:10.192146+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaUpdateatagconfigu1615195330\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaUpdateatagconfigu1615195330\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T09:22:11.353873+00:00\",\"modified_at\":\"2021-03-08T09:22:11.353873+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615241008139\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615241008139\"],\"include_percentiles\":false,\"created_at\":\"2021-03-08T22:03:28.250137+00:00\",\"modified_at\":\"2021-03-08T22:03:28.250137+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagconfigurationsreturnsSuccessresponse1618243860\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListtagconfigurationsreturnsSuccessresponse1618243860\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:11:00.453385+00:00\",\"modified_at\":\"2021-04-12T16:11:00.453385+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse507811615269834\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse507811615269834\"],\"include_percentiles\":false,\"created_at\":\"2021-03-09T06:03:55.035011+00:00\",\"modified_at\":\"2021-03-09T06:03:55.035011+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1615289582\",\"attributes\":{\"tags\":[\"javaListtagconfigurati1615289582\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-09T11:33:02.415435+00:00\",\"modified_at\":\"2021-03-09T11:33:02.415435+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse511141615397094\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse511141615397094\"],\"include_percentiles\":false,\"created_at\":\"2021-03-10T17:24:54.232169+00:00\",\"modified_at\":\"2021-03-10T17:24:54.232169+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse511141615397093\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse511141615397093\"],\"include_percentiles\":false,\"created_at\":\"2021-03-10T17:24:53.773142+00:00\",\"modified_at\":\"2021-03-10T17:24:53.773142+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagsbymetricnamereturnsSuccessresponse1615600096\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagsbymetricnamereturnsSuccessresponse1615600096\"],\"include_percentiles\":false,\"created_at\":\"2021-03-13T01:48:16.706740+00:00\",\"modified_at\":\"2021-03-13T01:48:16.706740+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyUpdateatagconfigurationreturnsOKresponse1615600097\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyUpdateatagconfigurationreturnsOKresponse1615600097\"],\"include_percentiles\":false,\"created_at\":\"2021-03-13T01:48:17.311123+00:00\",\"modified_at\":\"2021-03-13T01:48:17.311123+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615641825358\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615641825358\"],\"include_percentiles\":false,\"created_at\":\"2021-03-13T13:23:45.714258+00:00\",\"modified_at\":\"2021-03-13T13:23:45.714258+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1615728221108\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1615728221108\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-14T13:23:41.436621+00:00\",\"modified_at\":\"2021-03-14T13:23:41.436621+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615728219671\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615728219671\"],\"include_percentiles\":false,\"created_at\":\"2021-03-14T13:23:40.016425+00:00\",\"modified_at\":\"2021-03-14T13:23:40.016425+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615901000076\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1615901000076\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:20.213657+00:00\",\"modified_at\":\"2021-03-16T13:23:20.213657+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615900999594\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615900999594\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:19.703100+00:00\",\"modified_at\":\"2021-03-16T13:23:19.703100+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1615901001052\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1615901001052\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:21.193223+00:00\",\"modified_at\":\"2021-03-16T13:23:21.193223+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1615900999263\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:19.393024+00:00\",\"modified_at\":\"2021-03-16T13:23:19.393024+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1615901000614\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1615901000614\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:20.718208+00:00\",\"modified_at\":\"2021-03-16T13:23:20.718208+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615901006889\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1615901006889\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:27.006017+00:00\",\"modified_at\":\"2021-03-16T13:23:27.006017+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1615901007411\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1615901007411\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T13:23:27.541142+00:00\",\"modified_at\":\"2021-03-16T13:23:27.541142+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse519741615886584\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse519741615886584\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:04.506963+00:00\",\"modified_at\":\"2021-03-16T09:23:04.506963+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse519741615886584\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse519741615886584\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:04.173080+00:00\",\"modified_at\":\"2021-03-16T09:23:04.173080+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse519741615886585\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse519741615886585\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:05.166846+00:00\",\"modified_at\":\"2021-03-16T09:23:05.166846+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioCreateatagconfigurationreturnsCreatedresponse519741615886583\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:03.873546+00:00\",\"modified_at\":\"2021-03-16T09:23:03.873546+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse519741615886584\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse519741615886584\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:04.833632+00:00\",\"modified_at\":\"2021-03-16T09:23:04.833632+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse519741615886593\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse519741615886593\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:13.154433+00:00\",\"modified_at\":\"2021-03-16T09:23:13.154433+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse519741615886593\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse519741615886593\"],\"include_percentiles\":false,\"created_at\":\"2021-03-16T09:23:13.517437+00:00\",\"modified_at\":\"2021-03-16T09:23:13.517437+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1615998271598\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-17T16:24:31.959292+00:00\",\"modified_at\":\"2021-03-17T16:24:31.959292+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616160199767\",\"attributes\":{\"tags\":[\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616160199767\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:19.857702+00:00\",\"modified_at\":\"2021-03-19T13:23:19.857702+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse161616020553\",\"attributes\":{\"tags\":[\"TypescriptListtagsbymetricnamereturnsSuccessresponse161616020553\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:25.631513+00:00\",\"modified_at\":\"2021-03-19T13:23:25.631513+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1616160200146\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1616160200146\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:20.232463+00:00\",\"modified_at\":\"2021-03-19T13:23:20.232463+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616160198595\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:18.718201+00:00\",\"modified_at\":\"2021-03-19T13:23:18.718201+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616160198921\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616160198921\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:19.038247+00:00\",\"modified_at\":\"2021-03-19T13:23:19.038247+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616160199415\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616160199415\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:19.493780+00:00\",\"modified_at\":\"2021-03-19T13:23:19.493780+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1616160205992\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1616160205992\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T13:23:26.079138+00:00\",\"modified_at\":\"2021-03-19T13:23:26.079138+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615998272487\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1615998272487\"],\"include_percentiles\":false,\"created_at\":\"2021-03-17T16:24:32.839382+00:00\",\"modified_at\":\"2021-03-17T16:24:32.839382+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616149776487\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-19T10:29:36.901071+00:00\",\"modified_at\":\"2021-03-19T10:29:36.901071+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse161628985592\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-21T01:24:16.278639+00:00\",\"modified_at\":\"2021-03-21T01:24:16.826616+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1616085123642229\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagconfigurationbynamereturnssuccessresponse1616085123642229\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:03.966633+00:00\",\"modified_at\":\"2021-03-18T16:32:03.966633+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616085131743281\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616085131743281\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:12.060863+00:00\",\"modified_at\":\"2021-03-18T16:32:12.060863+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616085146387336\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616085146387336\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:26.695646+00:00\",\"modified_at\":\"2021-03-18T16:32:26.695646+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1616085149782964\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestupdateatagconfigurationreturnsokresponse1616085149782964\"],\"include_percentiles\":false,\"created_at\":\"2021-03-18T16:32:30.080251+00:00\",\"modified_at\":\"2021-03-18T16:32:30.080251+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse537181616565902\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse537181616565902\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:05:02.364811+00:00\",\"modified_at\":\"2021-03-24T06:05:02.364811+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse537181616565901\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse537181616565901\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:05:01.875172+00:00\",\"modified_at\":\"2021-03-24T06:05:01.875172+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse537181616565893\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioDeleteatagconfigurationreturnsNoContentresponse537181616565893\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:53.937128+00:00\",\"modified_at\":\"2021-03-24T06:04:53.937128+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse537181616565895\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse537181616565895\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:55.311874+00:00\",\"modified_at\":\"2021-03-24T06:04:55.311874+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioCreateatagconfigurationreturnsCreatedresponse537181616565893\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:53.604451+00:00\",\"modified_at\":\"2021-03-24T06:04:53.604451+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse537181616565894\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListdistinctmetricvolumesbymetricnamereturnsSuccessresponse537181616565894\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:54.427149+00:00\",\"modified_at\":\"2021-03-24T06:04:54.427149+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse537181616565894\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationbynamereturnsSuccessresponse537181616565894\"],\"include_percentiles\":false,\"created_at\":\"2021-03-24T06:04:54.866614+00:00\",\"modified_at\":\"2021-03-24T06:04:54.866614+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse161641942819\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:48.550450+00:00\",\"modified_at\":\"2021-03-22T13:23:48.550450+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1616419438471\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1616419438471\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:58.847497+00:00\",\"modified_at\":\"2021-03-22T13:23:58.847497+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616419430386\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616419430386\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:50.744154+00:00\",\"modified_at\":\"2021-03-22T13:23:50.744154+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616419429059\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1616419429059\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:49.434641+00:00\",\"modified_at\":\"2021-03-22T13:23:49.434641+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse161641943169\",\"attributes\":{\"tags\":[\"TypescriptListtagconfigurationbynamereturnsSuccessresponse161641943169\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:52.032469+00:00\",\"modified_at\":\"2021-03-22T13:23:52.032469+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1616419432884\",\"attributes\":{\"tags\":[\"datacenter\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1616419432884\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T13:23:53.144380+00:00\",\"modified_at\":\"2021-03-22T13:23:53.144380+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse532071616436253\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse532071616436253\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T18:04:13.105380+00:00\",\"modified_at\":\"2021-03-22T18:04:13.105380+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse532071616436253\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse532071616436253\"],\"include_percentiles\":false,\"created_at\":\"2021-03-22T18:04:13.474151+00:00\",\"modified_at\":\"2021-03-22T18:04:13.474151+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616671077838552\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlistdistinctmetricvolumesbymetricnamereturnssuccessresponse1616671077838552\"],\"include_percentiles\":false,\"created_at\":\"2021-03-25T11:17:58.568334+00:00\",\"modified_at\":\"2021-03-25T11:17:58.568334+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1616752499902025\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestdeleteatagconfigurationreturnsnocontentresponse1616752499902025\"],\"include_percentiles\":false,\"created_at\":\"2021-03-26T09:55:00.209674+00:00\",\"modified_at\":\"2021-03-26T09:55:00.209674+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616492360346493\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"datadogapiclientpythontestlisttagsbymetricnamereturnssuccessresponse1616492360346493\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T09:39:20.746200+00:00\",\"modified_at\":\"2021-03-23T09:39:20.746200+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616495055838\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T10:24:16.190783+00:00\",\"modified_at\":\"2021-03-23T10:24:16.190783+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616498654\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1616498654\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:14.161383+00:00\",\"modified_at\":\"2021-03-23T11:24:14.161383+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagconfigurationbynamereturnsSuccessresponse1616498654\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagconfigurationbynamereturnsSuccessresponse1616498654\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:14.567372+00:00\",\"modified_at\":\"2021-03-23T11:24:14.567372+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyDeleteatagconfigurationreturnsNoContentresponse1616498653\",\"attributes\":{\"tags\":[\"rubyDeleteatagconfigurationreturnsNoContentresponse1616498653\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-23T11:24:13.744787+00:00\",\"modified_at\":\"2021-03-23T11:24:13.744787+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1616894650949\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-28T01:24:11.315850+00:00\",\"modified_at\":\"2021-03-28T01:24:11.315850+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1617010239\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T09:30:39.277788+00:00\",\"modified_at\":\"2021-03-29T09:30:39.277788+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616840650426\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1616840650426\"],\"include_percentiles\":false,\"created_at\":\"2021-03-27T10:24:10.771619+00:00\",\"modified_at\":\"2021-03-27T10:24:10.771619+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1617013073\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T10:17:53.426838+00:00\",\"modified_at\":\"2021-03-29T10:17:53.426838+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagconfigurationsreturnsSuccessresponse1617013912\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagconfigurationsreturnsSuccessresponse1617013912\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T10:31:52.652432+00:00\",\"modified_at\":\"2021-03-29T10:31:52.652432+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1617014589345712\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-29T10:43:09.860304+00:00\",\"modified_at\":\"2021-03-29T10:43:09.860304+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse549511617084343\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse549511617084343\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T06:05:43.124191+00:00\",\"modified_at\":\"2021-03-30T06:05:43.124191+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse549511617084343\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse549511617084343\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T06:05:43.601969+00:00\",\"modified_at\":\"2021-03-30T06:05:43.601969+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1617190497075142\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T11:34:57.312061+00:00\",\"modified_at\":\"2021-03-31T11:34:57.312061+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyCreateatagconfigurationreturnsCreatedresponse1618116460\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-11T04:47:40.938028+00:00\",\"modified_at\":\"2021-04-11T04:47:40.938028+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse1617197102302\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T13:25:02.713019+00:00\",\"modified_at\":\"2021-03-31T13:25:02.713019+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse553521617208533\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagconfigurationsreturnsSuccessresponse553521617208533\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T16:35:33.822570+00:00\",\"modified_at\":\"2021-03-31T16:35:33.822570+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptUpdateatagconfigurationreturnsOKresponse1617110622671\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptUpdateatagconfigurationreturnsOKresponse1617110622671\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T13:23:42.813575+00:00\",\"modified_at\":\"2021-03-30T13:23:42.813575+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse161711062218\",\"attributes\":{\"tags\":[\"TypescriptListtagsbymetricnamereturnsSuccessresponse161711062218\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T13:23:42.290454+00:00\",\"modified_at\":\"2021-03-30T13:23:42.290454+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"datadogapiclientpythontestcreateatagconfigurationreturnscreatedresponse1617189605290728\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-03-31T11:20:05.512669+00:00\",\"modified_at\":\"2021-03-31T11:20:05.512669+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse550921617127471\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioListtagsbymetricnamereturnsSuccessresponse550921617127471\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T18:04:31.348364+00:00\",\"modified_at\":\"2021-03-30T18:04:31.348364+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse550921617127471\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"goFeatureMetricsScenarioUpdateatagconfigurationreturnsOKresponse550921617127471\"],\"include_percentiles\":false,\"created_at\":\"2021-03-30T18:04:31.750754+00:00\",\"modified_at\":\"2021-03-30T18:04:31.750754+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListdistinctmetric1617241055\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListdistinctmetric1617241055\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:35.979950+00:00\",\"modified_at\":\"2021-04-01T01:37:35.979950+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1617241056\",\"attributes\":{\"tags\":[\"javaListtagconfigurati1617241056\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:37.187124+00:00\",\"modified_at\":\"2021-04-01T01:37:37.187124+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagconfigurati1617241057\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagconfigurati1617241057\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:38.337846+00:00\",\"modified_at\":\"2021-04-01T01:37:38.337846+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"javaListtagsbymetric1617241065\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"javaListtagsbymetric1617241065\"],\"include_percentiles\":false,\"created_at\":\"2021-04-01T01:37:46.167234+00:00\",\"modified_at\":\"2021-04-01T01:37:46.167234+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationsreturnsSuccessresponse1617629121895\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationsreturnsSuccessresponse1617629121895\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:22.245313+00:00\",\"modified_at\":\"2021-04-05T13:25:22.245313+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1617629119345\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1617629119345\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:19.715171+00:00\",\"modified_at\":\"2021-04-05T13:25:19.715171+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1617629117988\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptDeleteatagconfigurationreturnsNoContentresponse1617629117988\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:18.355397+00:00\",\"modified_at\":\"2021-04-05T13:25:18.355397+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1617629120639\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagconfigurationbynamereturnsSuccessresponse1617629120639\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:20.999352+00:00\",\"modified_at\":\"2021-04-05T13:25:20.999352+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptListtagsbymetricnamereturnsSuccessresponse1617629131797\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TypescriptListtagsbymetricnamereturnsSuccessresponse1617629131797\"],\"include_percentiles\":false,\"created_at\":\"2021-04-05T13:25:32.056313+00:00\",\"modified_at\":\"2021-04-05T13:25:32.056313+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyDeleteatagconfigurationreturnsNoContentresponse1617414463\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyDeleteatagconfigurationreturnsNoContentresponse1617414463\"],\"include_percentiles\":false,\"created_at\":\"2021-04-03T01:47:43.121903+00:00\",\"modified_at\":\"2021-04-03T01:47:43.121903+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TypescriptCreateatagconfigurationreturnsCreatedresponse161776946527\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-07T04:24:25.610201+00:00\",\"modified_at\":\"2021-04-07T04:24:25.610201+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"tf_TestAccDatadogMetricTagConfiguration_import_57079_1617883575\",\"attributes\":{\"tags\":[\"datacenter\",\"sport\"],\"include_percentiles\":false,\"created_at\":\"2021-04-08T12:06:15.682733+00:00\",\"modified_at\":\"2021-04-08T12:06:15.682733+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"tf_TestAccDatadogMetricTagConfiguration_Basic_57079_1617883576\",\"attributes\":{\"tags\":[\"datacenter\",\"sport\"],\"include_percentiles\":false,\"created_at\":\"2021-04-08T12:06:16.328512+00:00\",\"modified_at\":\"2021-04-08T12:06:16.328512+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"rubyListtagconfigurationbynamereturnsSuccessresponse1617878848\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"rubyListtagconfigurationbynamereturnsSuccessresponse1617878848\"],\"include_percentiles\":false,\"created_at\":\"2021-04-08T10:47:28.651054+00:00\",\"modified_at\":\"2021-04-08T10:47:28.651054+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245205\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245205\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:33:26.065648+00:00\",\"modified_at\":\"2021-04-12T16:33:26.065648+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245209\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagconfigurationsreturnsSuccessresponse1618245209\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:33:29.921161+00:00\",\"modified_at\":\"2021-04-12T16:33:29.921161+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestGoUpdateatagconfigurationreturnsOKresponse1618245210\",\"attributes\":{\"tags\":[\"TestGoUpdateatagconfigurationreturnsOKresponse1618245210\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-12T16:33:30.912740+00:00\",\"modified_at\":\"2021-04-12T16:33:30.912740+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestListtagsbymetricnamereturnsSuccessresponse1618083821\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestListtagsbymetricnamereturnsSuccessresponse1618083821\"],\"include_percentiles\":false,\"created_at\":\"2021-04-10T19:43:42.330061+00:00\",\"modified_at\":\"2021-04-10T19:43:42.330061+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyUpdateatagconfigurationreturnsOKresponse1618477782\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyUpdateatagconfigurationreturnsOKresponse1618477782\"],\"include_percentiles\":false,\"created_at\":\"2021-04-15T09:09:42.695934+00:00\",\"modified_at\":\"2021-04-15T09:09:42.695934+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptUpdateatagconfigurationreturnsOKresponse1618576969\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-16T12:42:49.127510+00:00\",\"modified_at\":\"2021-04-16T12:42:49.222085+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationsreturnsSuccessresponse1618576965\",\"attributes\":{\"tags\":[\"TestPythonListtagconfigurationsreturnsSuccessresponse1618576965\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-16T12:42:45.376840+00:00\",\"modified_at\":\"2021-04-16T12:42:45.376840+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptUpdateatagconfigurationreturnsOKresponse1618828174\",\"attributes\":{\"tags\":[\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T10:29:34.758064+00:00\",\"modified_at\":\"2021-04-19T10:29:34.863258+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationsreturnsSuccessresponse1618828169\",\"attributes\":{\"tags\":[\"TestPythonListtagconfigurationsreturnsSuccessresponse1618828169\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T10:29:28.829677+00:00\",\"modified_at\":\"2021-04-19T10:29:28.829677+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestGoListtagconfigurationsreturnsSuccessresponse1618835558\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestGoListtagconfigurationsreturnsSuccessresponse1618835558\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T12:32:38.361429+00:00\",\"modified_at\":\"2021-04-19T12:32:38.361429+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1618817102\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1618817102\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T07:25:02.613361+00:00\",\"modified_at\":\"2021-04-19T07:25:02.613361+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618831533\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618831533\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T11:25:33.764565+00:00\",\"modified_at\":\"2021-04-19T11:25:33.764565+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618827476\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestPythonListtagconfigurationbynamereturnsSuccessresponse1618827476\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T10:17:56.919641+00:00\",\"modified_at\":\"2021-04-19T10:17:56.919641+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagsbymetricnamereturnsSuccessresponse1618861041\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagsbymetricnamereturnsSuccessresponse1618861041\"],\"include_percentiles\":false,\"created_at\":\"2021-04-19T19:37:21.909413+00:00\",\"modified_at\":\"2021-04-19T19:37:21.909413+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1618883262\",\"attributes\":{\"tags\":[\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1618883262\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-20T01:47:42.978537+00:00\",\"modified_at\":\"2021-04-20T01:47:42.978537+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619096218\",\"attributes\":{\"tags\":[\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619096218\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T12:56:58.362386+00:00\",\"modified_at\":\"2021-04-22T12:56:58.362386+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonCreateatagconfigurationreturnsCreatedresponse1619097915\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T13:25:31.443839+00:00\",\"modified_at\":\"2021-04-22T13:25:31.443839+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1619097911\",\"attributes\":{\"tags\":[\"TestTypescriptListtagsbymetricnamereturnsSuccessresponse1619097911\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T13:25:11.404186+00:00\",\"modified_at\":\"2021-04-22T13:25:11.404186+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListtagconfigurationsreturnsSuccessresponse1619096210\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestTypescriptListtagconfigurationsreturnsSuccessresponse1619096210\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T12:56:51.186137+00:00\",\"modified_at\":\"2021-04-22T12:56:51.186137+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagsbymetricnamereturnsSuccessresponse1619131204\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestJavaListtagsbymetricnamereturnsSuccessresponse1619131204\"],\"include_percentiles\":false,\"created_at\":\"2021-04-22T22:40:04.866275+00:00\",\"modified_at\":\"2021-04-22T22:40:04.866275+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationsreturnsSuccessresponse1619175153\",\"attributes\":{\"tags\":[\"datacenter\",\"TestJavaListtagconfigurationsreturnsSuccessresponse1619175153\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-23T10:52:33.873612+00:00\",\"modified_at\":\"2021-04-23T10:52:33.873612+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestTypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619175155\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestTypescriptListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619175155\"],\"include_percentiles\":false,\"created_at\":\"2021-04-23T10:52:35.693831+00:00\",\"modified_at\":\"2021-04-23T10:52:35.693831+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619282121\",\"attributes\":{\"tags\":[\"TestJavaListtagconfigurationbynamereturnsSuccessresponse1619282121\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T16:35:22.034065+00:00\",\"modified_at\":\"2021-04-24T16:35:22.034065+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyCreateatagconfigurationreturnsCreatedresponse1619228878\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:47:59.109548+00:00\",\"modified_at\":\"2021-04-24T01:47:59.109548+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyDeleteatagconfigurationreturnsNoContentresponse1619228879\",\"attributes\":{\"tags\":[\"TestRubyDeleteatagconfigurationreturnsNoContentresponse1619228879\",\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:47:59.465861+00:00\",\"modified_at\":\"2021-04-24T01:47:59.465861+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyUpdateatagconfigurationreturnsOKresponse1619228888\",\"attributes\":{\"tags\":[\"TestRubyUpdateatagconfigurationreturnsOKresponse1619228888\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:48:08.955735+00:00\",\"modified_at\":\"2021-04-24T01:48:08.955735+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619228879\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListdistinctmetricvolumesbymetricnamereturnsSuccessresponse1619228879\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:47:59.924705+00:00\",\"modified_at\":\"2021-04-24T01:47:59.924705+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1619228880\",\"attributes\":{\"tags\":[\"datacenter\",\"app\",\"TestRubyListtagconfigurationbynamereturnsSuccessresponse1619228880\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:48:00.601042+00:00\",\"modified_at\":\"2021-04-24T01:48:00.601042+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestRubyListtagsbymetricnamereturnsSuccessresponse1619228888\",\"attributes\":{\"tags\":[\"TestRubyListtagsbymetricnamereturnsSuccessresponse1619228888\",\"app\",\"datacenter\"],\"include_percentiles\":false,\"created_at\":\"2021-04-24T01:48:08.489900+00:00\",\"modified_at\":\"2021-04-24T01:48:08.489900+00:00\",\"metric_type\":\"distribution\"}},{\"type\":\"manage_tags\",\"id\":\"TestPythonCreateatagconfigurationreturnsCreatedresponse1619421459\",\"attributes\":{\"tags\":[\"datacenter\",\"app\"],\"include_percentiles\":false,\"created_at\":\"2021-04-26T07:17:40.163589+00:00\",\"modified_at\":\"2021-04-26T07:17:40.163589+00:00\",\"metric_type\":\"distribution\"}}]}\n" - }, - "cookies": [], - "headers": [ - { - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 625, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 200, - "statusText": "OK" - }, - "startedDateTime": "2022-08-05T07:10:55.086Z", - "time": 1774 - } - ], - "pages": [], - "version": "1.2" - } -} From 657eb63c20543bb814eafc642b0ccf3bea91d811 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 8 Sep 2022 13:51:27 +0000 Subject: [PATCH 07/30] Exit early when generation fails (#831) * introduce pre-commit wrapper * remove echo * Regenerate client from commit 33b7a42c of spec repo Co-authored-by: Sherzod Karimov Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 ++++---- .pre-commit-config.yaml | 2 +- Makefile | 8 -------- generate.sh | 31 +++++++++++++++++++++++++++++++ 4 files changed, 36 insertions(+), 13 deletions(-) delete mode 100644 Makefile create mode 100755 generate.sh diff --git a/.apigentools-info b/.apigentools-info index 746895e59aae..e8428d1394d9 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-06 20:46:59.630821", - "spec_repo_commit": "36a61042" + "regenerated": "2022-09-07 19:30:40.870279", + "spec_repo_commit": "33b7a42c" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-06 20:46:59.643602", - "spec_repo_commit": "36a61042" + "regenerated": "2022-09-07 19:30:40.887104", + "spec_repo_commit": "33b7a42c" } } } \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f574d2134cb2..5d4bb7c23035 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ repos: - id: generate name: Generate language: node - entry: make + entry: bash -c "./generate.sh" files: '^(\.generator/.*|\.pre-commit-config\.yaml|package\.json|yarn\.lock|\.eslintrc\.js|Makefile|\features/.*)' pass_filenames: false - id: lint diff --git a/Makefile b/Makefile deleted file mode 100644 index 26314359fd0e..000000000000 --- a/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -.PHONY: all -all: .generator - @rm -rf packages/datadog-api-client-v*/ examples/v* - @rm -rf packages/datadog-api-client-*/ - @pre-commit run --all-files --hook-stage=manual generator || true - @pre-commit run --all-files --hook-stage=manual lint || echo "modified files" - @pre-commit run --all-files --hook-stage=manual examples || true - @pre-commit run --all-files --hook-stage=manual lint-examples || echo "modified files" diff --git a/generate.sh b/generate.sh new file mode 100755 index 000000000000..d2f5002ec752 --- /dev/null +++ b/generate.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +DEFAULT_ERROR_CODES="0" + +# First arg is the command +# Second arg is the string of acceptable error codes seperated by space. E.g. "0 1" +pre_commit_wrapper () { + echo "running pre-commit run --all-files --hook-stage=manual ${1}" + + exec 5>&1 + acceptable_errors=${2:-$DEFAULT_ERROR_CODES} + out=$(pre-commit run --all-files --hook-stage=manual "${1}" | tee >(cat - >&5)) + exit_code=$( echo "$out" | grep -- "- exit code:" | cut -d":" -f2 | sed 's/[^0-9]*//g' ) + + if [[ -n $exit_code ]]; then + re="([^0-9]|^)$exit_code([^0-9]|$)" + if ! grep -qE "$re" <<< "$acceptable_errors" ; then + echo "pre-commit subcommand failed with error_code: $exit_code. See output above" + exit "$exit_code"; + fi + fi + + echo "command 'pre-commit run --all-files --hook-stage=manual ${1}' success" +} + +rm -rf packages/datadog-api-client-v*/ examples/v* +rm -rf packages/datadog-api-client-*/ +pre_commit_wrapper generator +pre_commit_wrapper lint +pre_commit_wrapper examples +pre_commit_wrapper lint-examples From 48c5d22941a78e213376499e09ae64bbd3a881d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Mon, 12 Sep 2022 15:41:26 +0200 Subject: [PATCH 08/30] Refactor error handling to remove duplication (#834) --- .generator/src/generator/cli.py | 1 + .generator/src/generator/openapi.py | 11 + .generator/src/generator/templates/api/api.j2 | 26 +- .generator/src/generator/templates/util.j2 | 28 - packages/datadog-api-client-common/util.ts | 32 - .../apis/AWSIntegrationApi.ts | 304 ++--- .../apis/AWSLogsIntegrationApi.ts | 213 +-- .../apis/AuthenticationApi.ts | 21 +- .../apis/AzureIntegrationApi.ts | 161 +-- .../apis/DashboardListsApi.ts | 158 +-- .../apis/DashboardsApi.ts | 234 +--- .../apis/DowntimesApi.ts | 228 +--- .../datadog-api-client-v1/apis/EventsApi.ts | 85 +- .../apis/GCPIntegrationApi.ts | 129 +- .../datadog-api-client-v1/apis/HostsApi.ts | 129 +- .../datadog-api-client-v1/apis/IPRangesApi.ts | 13 +- .../apis/KeyManagementApi.ts | 342 ++--- .../datadog-api-client-v1/apis/LogsApi.ts | 50 +- .../apis/LogsIndexesApi.ts | 161 +-- .../apis/LogsPipelinesApi.ts | 196 +-- .../datadog-api-client-v1/apis/MetricsApi.ts | 270 +--- .../datadog-api-client-v1/apis/MonitorsApi.ts | 374 ++---- .../apis/NotebooksApi.ts | 194 +-- .../apis/OrganizationsApi.ts | 190 +-- .../apis/PagerDutyIntegrationApi.ts | 132 +- .../apis/SecurityMonitoringApi.ts | 124 +- .../apis/ServiceChecksApi.ts | 51 +- .../ServiceLevelObjectiveCorrectionsApi.ts | 164 +-- .../apis/ServiceLevelObjectivesApi.ts | 373 ++---- .../apis/SlackIntegrationApi.ts | 203 +-- .../apis/SnapshotsApi.ts | 33 +- .../apis/SyntheticsApi.ts | 818 +++--------- .../datadog-api-client-v1/apis/TagsApi.ts | 158 +-- .../apis/UsageMeteringApi.ts | 1166 +++++------------ .../datadog-api-client-v1/apis/UsersApi.ts | 176 +-- .../apis/WebhooksIntegrationApi.ts | 287 ++-- .../datadog-api-client-v2/apis/AuditApi.ts | 65 +- .../apis/AuthNMappingsApi.ts | 182 +-- .../apis/CloudWorkloadSecurityApi.ts | 190 +-- .../apis/DashboardListsApi.ts | 156 +-- .../datadog-api-client-v2/apis/EventsApi.ts | 65 +- .../apis/IncidentServicesApi.ts | 248 +--- .../apis/IncidentTeamsApi.ts | 248 +--- .../apis/IncidentsApi.ts | 248 +--- .../apis/KeyManagementApi.ts | 494 ++----- .../datadog-api-client-v2/apis/LogsApi.ts | 174 +-- .../apis/LogsArchivesApi.ts | 351 ++--- .../apis/LogsMetricsApi.ts | 164 +-- .../datadog-api-client-v2/apis/MetricsApi.ts | 472 ++----- .../apis/OpsgenieIntegrationApi.ts | 200 +-- .../apis/OrganizationsApi.ts | 30 +- .../apis/ProcessesApi.ts | 33 +- packages/datadog-api-client-v2/apis/RUMApi.ts | 215 +-- .../datadog-api-client-v2/apis/RolesApi.ts | 474 ++----- .../apis/SecurityMonitoringApi.ts | 511 ++------ .../apis/ServiceAccountsApi.ts | 176 +-- .../apis/UsageMeteringApi.ts | 193 +-- .../datadog-api-client-v2/apis/UsersApi.ts | 336 ++--- 58 files changed, 3236 insertions(+), 9224 deletions(-) diff --git a/.generator/src/generator/cli.py b/.generator/src/generator/cli.py index 19e1c7195fd7..2e6b6b8b6e38 100644 --- a/.generator/src/generator/cli.py +++ b/.generator/src/generator/cli.py @@ -42,6 +42,7 @@ def cli(specs, output): env.filters["form_parameter"] = openapi.form_parameter env.filters["untitle_case"] = formatter.untitle_case env.filters["response_type"] = openapi.get_type_for_response + env.filters["responses_by_types"] = openapi.responses_by_types env.filters["docstring"] = formatter.docstring env.globals["get_references_for_model"] = openapi.get_references_for_model diff --git a/.generator/src/generator/openapi.py b/.generator/src/generator/openapi.py index 00b50382e643..bc5bb5d4b411 100644 --- a/.generator/src/generator/openapi.py +++ b/.generator/src/generator/openapi.py @@ -339,6 +339,17 @@ def get_type_for_response(response): return type_to_typescript(content["schema"]) +def responses_by_types(operation): + result = {} + for response_code, response in operation["responses"].items(): + response_type = get_type_for_response(response) + if response_type in result: + result[response_type][1].append(response_code) + else: + result[response_type] = [response, [response_code]] + return result.items() + + def return_type(operation): for response in operation.get("responses", {}).values(): for content in response.get("content", {}).values(): diff --git a/.generator/src/generator/templates/api/api.j2 b/.generator/src/generator/templates/api/api.j2 index 91aa5cb7beb3..ec1ef94db7e8 100644 --- a/.generator/src/generator/templates/api/api.j2 +++ b/.generator/src/generator/templates/api/api.j2 @@ -12,7 +12,6 @@ import FormData from "form-data"; import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; {% for model in get_api_models(operations)|sort %} import { {{ model }} } from "../models/{{ model }}"; @@ -163,26 +162,29 @@ export class {{ className }}ResponseProcessor { */ public async {{ operationId }}(response: ResponseContext): Promise<{%- if returnType %}{{ returnType }} {%- else %}void{%-endif %}> { const contentType = ObjectSerializer.normalizeMediaType(response.headers["content-type"]); - {%- for responseCode, response in operation.responses.items() %} + {%- for responseType, (response, responseCodes) in operation|responses_by_types %} {%- set responseSchema = response|parameter_schema %} - {%- set reponseType = response|response_type %} - if (isCodeInRange("{{ responseCode }}", response.httpStatusCode)) { - {%- if reponseType %} + if ( + {%- for responseCode in responseCodes -%} + {%- if not loop.first -%} || {%- endif -%} response.httpStatusCode == {{ responseCode }} + {%- endfor -%} + ) { + {%- if responseType %} {%- if responseSchema and responseSchema.get("format") == "binary" %} - const body: {{ reponseType }} = await response.getBodyAsFile() as {{ returnType }}; + const body: {{ responseType }} = await response.getBodyAsFile() as {{ returnType }}; {%- else %} - const body: {{ reponseType }} = ObjectSerializer.deserialize( + const body: {{ responseType }} = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "{{ reponseType }}", "{{ responseSchema.get("format", "") }}" - ) as {{ reponseType }}; + "{{ responseType }}" + ) as {{ responseType }}; {%- endif %} - {%- if responseCode.startswith("2") %} + {%- if responseCodes[0].startswith("2") %} return body; {%- else %} - throw new ApiException<{{ reponseType }}>({{ responseCode }}, body); + throw new ApiException<{{ responseType }}>(response.httpStatusCode, body); {%- endif %} {%- else %} - {%- if responseCode.startswith("2") %} + {%- if responseCodes[0].startswith("2") %} return; {%- else %} throw new ApiException(response.httpStatusCode, "{{ responseSchema.description }}"); diff --git a/.generator/src/generator/templates/util.j2 b/.generator/src/generator/templates/util.j2 index c891937e4862..1e0be58ea46b 100644 --- a/.generator/src/generator/templates/util.j2 +++ b/.generator/src/generator/templates/util.j2 @@ -1,31 +1,3 @@ -/** - * Returns if a specific http code is in a given code range - * where the code range is defined as a combination of digits - * and "X" (the letter X) with a length of 3 - * - * @param codeRange string with length 3 consisting of digits and "X" (the letter X) - * @param code the http status code to be checked against the code range - */ -export function isCodeInRange(codeRange: string, code: number): boolean { - // This is how the default value is encoded in OAG - if (codeRange === "0") { - return true; - } - if (codeRange == code.toString()) { - return true; - } else { - const codeString = code.toString(); - if (codeString.length != codeRange.length) { - return false; - } - for (let i = 0; i < codeString.length; i++) { - if (codeRange.charAt(i) != "X" && codeRange.charAt(i) != codeString.charAt(i)) { - return false; - } - } - return true; - } -} export class UnparsedObject { unparsedObject:any; diff --git a/packages/datadog-api-client-common/util.ts b/packages/datadog-api-client-common/util.ts index 37479aa2f5a4..300955e4388d 100644 --- a/packages/datadog-api-client-common/util.ts +++ b/packages/datadog-api-client-common/util.ts @@ -1,35 +1,3 @@ -/** - * Returns if a specific http code is in a given code range - * where the code range is defined as a combination of digits - * and "X" (the letter X) with a length of 3 - * - * @param codeRange string with length 3 consisting of digits and "X" (the letter X) - * @param code the http status code to be checked against the code range - */ -export function isCodeInRange(codeRange: string, code: number): boolean { - // This is how the default value is encoded in OAG - if (codeRange === "0") { - return true; - } - if (codeRange == code.toString()) { - return true; - } else { - const codeString = code.toString(); - if (codeString.length != codeRange.length) { - return false; - } - for (let i = 0; i < codeString.length; i++) { - if ( - codeRange.charAt(i) != "X" && - codeRange.charAt(i) != codeString.charAt(i) - ) { - return false; - } - } - return true; - } -} - export class UnparsedObject { unparsedObject: any; constructor(data: any) { diff --git a/packages/datadog-api-client-v1/apis/AWSIntegrationApi.ts b/packages/datadog-api-client-v1/apis/AWSIntegrationApi.ts index 521893120c15..73db093664f3 100644 --- a/packages/datadog-api-client-v1/apis/AWSIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/AWSIntegrationApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { AWSAccount } from "../models/AWSAccount"; @@ -443,45 +442,24 @@ export class AWSIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AWSAccountCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AWSAccountCreateResponse", - "" + "AWSAccountCreateResponse" ) as AWSAccountCreateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -512,37 +490,23 @@ export class AWSIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -575,37 +539,23 @@ export class AWSIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AWSAccountCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AWSAccountCreateResponse", - "" + "AWSAccountCreateResponse" ) as AWSAccountCreateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -636,45 +586,24 @@ export class AWSIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -705,37 +634,23 @@ export class AWSIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -768,29 +683,19 @@ export class AWSIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Array = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Array", - "" + "Array" ) as Array; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -823,37 +728,23 @@ export class AWSIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AWSAccountListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AWSAccountListResponse", - "" + "AWSAccountListResponse" ) as AWSAccountListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -886,37 +777,23 @@ export class AWSIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AWSTagFilterListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AWSTagFilterListResponse", - "" + "AWSTagFilterListResponse" ) as AWSTagFilterListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -947,45 +824,24 @@ export class AWSIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/AWSLogsIntegrationApi.ts b/packages/datadog-api-client-v1/apis/AWSLogsIntegrationApi.ts index 911234e8402e..93409c565179 100644 --- a/packages/datadog-api-client-v1/apis/AWSLogsIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/AWSLogsIntegrationApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { AWSAccountAndLambdaRequest } from "../models/AWSAccountAndLambdaRequest"; @@ -311,37 +310,23 @@ export class AWSLogsIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AWSLogsAsyncResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AWSLogsAsyncResponse", - "" + "AWSLogsAsyncResponse" ) as AWSLogsAsyncResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -374,37 +359,23 @@ export class AWSLogsIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AWSLogsAsyncResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AWSLogsAsyncResponse", - "" + "AWSLogsAsyncResponse" ) as AWSLogsAsyncResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -435,37 +406,23 @@ export class AWSLogsIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -496,37 +453,23 @@ export class AWSLogsIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -557,37 +500,23 @@ export class AWSLogsIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -620,37 +549,23 @@ export class AWSLogsIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Array = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Array", - "" + "Array" ) as Array; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -683,30 +598,20 @@ export class AWSLogsIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Array = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Array", - "" + "Array" ) as Array; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/AuthenticationApi.ts b/packages/datadog-api-client-v1/apis/AuthenticationApi.ts index da85119bbd6f..32cc72e58630 100644 --- a/packages/datadog-api-client-v1/apis/AuthenticationApi.ts +++ b/packages/datadog-api-client-v1/apis/AuthenticationApi.ts @@ -12,7 +12,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { AuthenticationValidationResponse } from "../models/AuthenticationValidationResponse"; @@ -56,30 +55,20 @@ export class AuthenticationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AuthenticationValidationResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AuthenticationValidationResponse", - "" + "AuthenticationValidationResponse" ) as AuthenticationValidationResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/AzureIntegrationApi.ts b/packages/datadog-api-client-v1/apis/AzureIntegrationApi.ts index 73d640bd9fef..189737183760 100644 --- a/packages/datadog-api-client-v1/apis/AzureIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/AzureIntegrationApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { AzureAccount } from "../models/AzureAccount"; @@ -235,37 +234,23 @@ export class AzureIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -296,37 +281,23 @@ export class AzureIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -359,37 +330,23 @@ export class AzureIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Array = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Array", - "" + "Array" ) as Array; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -420,37 +377,23 @@ export class AzureIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -481,37 +424,23 @@ export class AzureIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/DashboardListsApi.ts b/packages/datadog-api-client-v1/apis/DashboardListsApi.ts index 9c7679878229..7bc973df64dc 100644 --- a/packages/datadog-api-client-v1/apis/DashboardListsApi.ts +++ b/packages/datadog-api-client-v1/apis/DashboardListsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { DashboardList } from "../models/DashboardList"; @@ -239,37 +238,23 @@ export class DashboardListsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DashboardList = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DashboardList", - "" + "DashboardList" ) as DashboardList; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -302,37 +287,23 @@ export class DashboardListsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DashboardListDeleteResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DashboardListDeleteResponse", - "" + "DashboardListDeleteResponse" ) as DashboardListDeleteResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -365,37 +336,23 @@ export class DashboardListsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DashboardList = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DashboardList", - "" + "DashboardList" ) as DashboardList; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -428,29 +385,19 @@ export class DashboardListsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DashboardListListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DashboardListListResponse", - "" + "DashboardListListResponse" ) as DashboardListListResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -483,45 +430,24 @@ export class DashboardListsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DashboardList = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DashboardList", - "" + "DashboardList" ) as DashboardList; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/DashboardsApi.ts b/packages/datadog-api-client-v1/apis/DashboardsApi.ts index 4497a608bfd1..1b4b932983a2 100644 --- a/packages/datadog-api-client-v1/apis/DashboardsApi.ts +++ b/packages/datadog-api-client-v1/apis/DashboardsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { Dashboard } from "../models/Dashboard"; @@ -345,37 +344,23 @@ export class DashboardsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Dashboard = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Dashboard", - "" + "Dashboard" ) as Dashboard; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -408,37 +393,23 @@ export class DashboardsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DashboardDeleteResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DashboardDeleteResponse", - "" + "DashboardDeleteResponse" ) as DashboardDeleteResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -469,40 +440,20 @@ export class DashboardsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -533,37 +484,23 @@ export class DashboardsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Dashboard = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Dashboard", - "" + "Dashboard" ) as Dashboard; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -596,29 +533,19 @@ export class DashboardsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DashboardSummary = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DashboardSummary", - "" + "DashboardSummary" ) as DashboardSummary; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -649,40 +576,20 @@ export class DashboardsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -713,45 +620,24 @@ export class DashboardsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Dashboard = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Dashboard", - "" + "Dashboard" ) as Dashboard; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/DowntimesApi.ts b/packages/datadog-api-client-v1/apis/DowntimesApi.ts index 4a368225ff27..5291d689da2b 100644 --- a/packages/datadog-api-client-v1/apis/DowntimesApi.ts +++ b/packages/datadog-api-client-v1/apis/DowntimesApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { CancelDowntimesByScopeRequest } from "../models/CancelDowntimesByScopeRequest"; @@ -328,32 +327,19 @@ export class DowntimesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -386,45 +372,24 @@ export class DowntimesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: CanceledDowntimesIds = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CanceledDowntimesIds", - "" + "CanceledDowntimesIds" ) as CanceledDowntimesIds; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -455,37 +420,23 @@ export class DowntimesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Downtime = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Downtime", - "" + "Downtime" ) as Downtime; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -516,37 +467,23 @@ export class DowntimesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Downtime = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Downtime", - "" + "Downtime" ) as Downtime; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -579,29 +516,19 @@ export class DowntimesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Array = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Array", - "" + "Array" ) as Array; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -634,37 +561,23 @@ export class DowntimesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Array = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Array", - "" + "Array" ) as Array; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -695,45 +608,24 @@ export class DowntimesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Downtime = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Downtime", - "" + "Downtime" ) as Downtime; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/EventsApi.ts b/packages/datadog-api-client-v1/apis/EventsApi.ts index c89ef245fe5a..cc9773580a65 100644 --- a/packages/datadog-api-client-v1/apis/EventsApi.ts +++ b/packages/datadog-api-client-v1/apis/EventsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { EventCreateRequest } from "../models/EventCreateRequest"; @@ -216,29 +215,19 @@ export class EventsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("202", response.httpStatusCode)) { + if (response.httpStatusCode == 202) { const body: EventCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "EventCreateResponse", - "" + "EventCreateResponse" ) as EventCreateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -269,37 +258,23 @@ export class EventsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: EventResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "EventResponse", - "" + "EventResponse" ) as EventResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -332,37 +307,23 @@ export class EventsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: EventListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "EventListResponse", - "" + "EventListResponse" ) as EventListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/GCPIntegrationApi.ts b/packages/datadog-api-client-v1/apis/GCPIntegrationApi.ts index ec5c3791536b..8a386436d674 100644 --- a/packages/datadog-api-client-v1/apis/GCPIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/GCPIntegrationApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { GCPAccount } from "../models/GCPAccount"; @@ -191,37 +190,23 @@ export class GCPIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -252,37 +237,23 @@ export class GCPIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -315,37 +286,23 @@ export class GCPIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Array = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Array", - "" + "Array" ) as Array; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -376,37 +333,23 @@ export class GCPIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/HostsApi.ts b/packages/datadog-api-client-v1/apis/HostsApi.ts index e2256aea98eb..f327a58a428d 100644 --- a/packages/datadog-api-client-v1/apis/HostsApi.ts +++ b/packages/datadog-api-client-v1/apis/HostsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { HostListResponse } from "../models/HostListResponse"; @@ -247,37 +246,23 @@ export class HostsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: HostTotals = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostTotals", - "" + "HostTotals" ) as HostTotals; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -308,37 +293,23 @@ export class HostsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: HostListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostListResponse", - "" + "HostListResponse" ) as HostListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -369,37 +340,23 @@ export class HostsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: HostMuteResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostMuteResponse", - "" + "HostMuteResponse" ) as HostMuteResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -432,37 +389,23 @@ export class HostsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: HostMuteResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostMuteResponse", - "" + "HostMuteResponse" ) as HostMuteResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/IPRangesApi.ts b/packages/datadog-api-client-v1/apis/IPRangesApi.ts index 4a137df1c0ff..bcfd14384a0d 100644 --- a/packages/datadog-api-client-v1/apis/IPRangesApi.ts +++ b/packages/datadog-api-client-v1/apis/IPRangesApi.ts @@ -11,7 +11,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { IPRanges } from "../models/IPRanges"; @@ -47,21 +46,19 @@ export class IPRangesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: IPRanges = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IPRanges", - "" + "IPRanges" ) as IPRanges; return body; } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/KeyManagementApi.ts b/packages/datadog-api-client-v1/apis/KeyManagementApi.ts index ed0c82a944cb..d61bdb13a0ef 100644 --- a/packages/datadog-api-client-v1/apis/KeyManagementApi.ts +++ b/packages/datadog-api-client-v1/apis/KeyManagementApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { ApiKey } from "../models/ApiKey"; @@ -431,37 +430,23 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApiKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApiKeyResponse", - "" + "ApiKeyResponse" ) as ApiKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -494,45 +479,24 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationKeyResponse", - "" + "ApplicationKeyResponse" ) as ApplicationKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -565,45 +529,24 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApiKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApiKeyResponse", - "" + "ApiKeyResponse" ) as ApiKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -636,37 +579,23 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationKeyResponse", - "" + "ApplicationKeyResponse" ) as ApplicationKeyResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -697,37 +626,23 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApiKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApiKeyResponse", - "" + "ApiKeyResponse" ) as ApiKeyResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -760,37 +675,23 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationKeyResponse", - "" + "ApplicationKeyResponse" ) as ApplicationKeyResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -823,29 +724,19 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApiKeyListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApiKeyListResponse", - "" + "ApiKeyListResponse" ) as ApiKeyListResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -878,29 +769,19 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApplicationKeyListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationKeyListResponse", - "" + "ApplicationKeyListResponse" ) as ApplicationKeyListResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -933,45 +814,24 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApiKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApiKeyResponse", - "" + "ApiKeyResponse" ) as ApiKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1004,53 +864,25 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationKeyResponse", - "" + "ApplicationKeyResponse" ) as ApplicationKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/LogsApi.ts b/packages/datadog-api-client-v1/apis/LogsApi.ts index 3e6e80ee1b69..f5b03c2b901c 100644 --- a/packages/datadog-api-client-v1/apis/LogsApi.ts +++ b/packages/datadog-api-client-v1/apis/LogsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { ContentEncoding } from "../models/ContentEncoding"; @@ -145,37 +144,29 @@ export class LogsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsListResponse", - "" + "LogsListResponse" ) as LogsListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400) { const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" + "LogsAPIErrorResponse" ) as LogsAPIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); + throw new ApiException( + response.httpStatusCode, + body + ); } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -206,29 +197,26 @@ export class LogsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400) { const body: HTTPLogError = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HTTPLogError", - "" + "HTTPLogError" ) as HTTPLogError; - throw new ApiException(400, body); + throw new ApiException(response.httpStatusCode, body); } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts b/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts index 8b770803dee4..37d6c90f2404 100644 --- a/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts +++ b/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { LogsAPIErrorResponse } from "../models/LogsAPIErrorResponse"; @@ -269,37 +268,29 @@ export class LogsIndexesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsIndex = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsIndex", - "" + "LogsIndex" ) as LogsIndex; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400) { const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" + "LogsAPIErrorResponse" ) as LogsAPIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); + throw new ApiException( + response.httpStatusCode, + body + ); } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -330,37 +321,29 @@ export class LogsIndexesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsIndex = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsIndex", - "" + "LogsIndex" ) as LogsIndex; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); + throw new ApiException(response.httpStatusCode, body); } - if (isCodeInRange("404", response.httpStatusCode)) { + if (response.httpStatusCode == 404) { const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" + "LogsAPIErrorResponse" ) as LogsAPIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException( + response.httpStatusCode, + body + ); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -393,29 +376,19 @@ export class LogsIndexesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsIndexesOrder = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsIndexesOrder", - "" + "LogsIndexesOrder" ) as LogsIndexesOrder; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -448,29 +421,19 @@ export class LogsIndexesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsIndexListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsIndexListResponse", - "" + "LogsIndexListResponse" ) as LogsIndexListResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -501,37 +464,29 @@ export class LogsIndexesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsIndex = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsIndex", - "" + "LogsIndex" ) as LogsIndex; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" + "LogsAPIErrorResponse" ) as LogsAPIErrorResponse; - throw new ApiException(400, body); + throw new ApiException( + response.httpStatusCode, + body + ); } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" - ) as LogsAPIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -564,37 +519,29 @@ export class LogsIndexesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsIndexesOrder = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsIndexesOrder", - "" + "LogsIndexesOrder" ) as LogsIndexesOrder; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400) { const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" + "LogsAPIErrorResponse" ) as LogsAPIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); + throw new ApiException( + response.httpStatusCode, + body + ); } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/LogsPipelinesApi.ts b/packages/datadog-api-client-v1/apis/LogsPipelinesApi.ts index f9a4cabfb8f4..35ca884ebacb 100644 --- a/packages/datadog-api-client-v1/apis/LogsPipelinesApi.ts +++ b/packages/datadog-api-client-v1/apis/LogsPipelinesApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { LogsAPIErrorResponse } from "../models/LogsAPIErrorResponse"; @@ -306,37 +305,29 @@ export class LogsPipelinesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsPipeline = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsPipeline", - "" + "LogsPipeline" ) as LogsPipeline; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400) { const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" + "LogsAPIErrorResponse" ) as LogsAPIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); + throw new ApiException( + response.httpStatusCode, + body + ); } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -367,32 +358,25 @@ export class LogsPipelinesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400) { const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" + "LogsAPIErrorResponse" ) as LogsAPIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); + throw new ApiException( + response.httpStatusCode, + body + ); } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -425,37 +409,29 @@ export class LogsPipelinesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsPipeline = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsPipeline", - "" + "LogsPipeline" ) as LogsPipeline; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400) { const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" + "LogsAPIErrorResponse" ) as LogsAPIErrorResponse; - throw new ApiException(400, body); + throw new ApiException( + response.httpStatusCode, + body + ); } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -488,29 +464,19 @@ export class LogsPipelinesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsPipelinesOrder = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsPipelinesOrder", - "" + "LogsPipelinesOrder" ) as LogsPipelinesOrder; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -543,29 +509,19 @@ export class LogsPipelinesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Array = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Array", - "" + "Array" ) as Array; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -598,37 +554,29 @@ export class LogsPipelinesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsPipeline = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsPipeline", - "" + "LogsPipeline" ) as LogsPipeline; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400) { const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" + "LogsAPIErrorResponse" ) as LogsAPIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); + throw new ApiException( + response.httpStatusCode, + body + ); } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -661,45 +609,29 @@ export class LogsPipelinesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsPipelinesOrder = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsPipelinesOrder", - "" + "LogsPipelinesOrder" ) as LogsPipelinesOrder; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400 || response.httpStatusCode == 422) { const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" + "LogsAPIErrorResponse" ) as LogsAPIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("422", response.httpStatusCode)) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse", - "" - ) as LogsAPIErrorResponse; - throw new ApiException(422, body); + throw new ApiException( + response.httpStatusCode, + body + ); } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/MetricsApi.ts b/packages/datadog-api-client-v1/apis/MetricsApi.ts index 752b0fca8676..4dc99f2e80b7 100644 --- a/packages/datadog-api-client-v1/apis/MetricsApi.ts +++ b/packages/datadog-api-client-v1/apis/MetricsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { DistributionPointsContentEncoding } from "../models/DistributionPointsContentEncoding"; @@ -404,37 +403,23 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricMetadata = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricMetadata", - "" + "MetricMetadata" ) as MetricMetadata; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -467,37 +452,23 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricsListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricsListResponse", - "" + "MetricsListResponse" ) as MetricsListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -530,37 +501,23 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricSearchResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricSearchResponse", - "" + "MetricSearchResponse" ) as MetricSearchResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -593,37 +550,23 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricsQueryResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricsQueryResponse", - "" + "MetricsQueryResponse" ) as MetricsQueryResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -656,53 +599,25 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("202", response.httpStatusCode)) { + if (response.httpStatusCode == 202) { const body: IntakePayloadAccepted = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IntakePayloadAccepted", - "" + "IntakePayloadAccepted" ) as IntakePayloadAccepted; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("408", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 408 || + response.httpStatusCode == 413 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(408, body); - } - if (isCodeInRange("413", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(413, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -735,53 +650,25 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("202", response.httpStatusCode)) { + if (response.httpStatusCode == 202) { const body: IntakePayloadAccepted = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IntakePayloadAccepted", - "" + "IntakePayloadAccepted" ) as IntakePayloadAccepted; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("408", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 408 || + response.httpStatusCode == 413 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(408, body); - } - if (isCodeInRange("413", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(413, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -814,45 +701,24 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricMetadata = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricMetadata", - "" + "MetricMetadata" ) as MetricMetadata; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/MonitorsApi.ts b/packages/datadog-api-client-v1/apis/MonitorsApi.ts index 9d83772c1b54..7b49adbbd94f 100644 --- a/packages/datadog-api-client-v1/apis/MonitorsApi.ts +++ b/packages/datadog-api-client-v1/apis/MonitorsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { CheckCanDeleteMonitorResponse } from "../models/CheckCanDeleteMonitorResponse"; @@ -573,45 +572,23 @@ export class MonitorsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200 || response.httpStatusCode == 409) { const body: CheckCanDeleteMonitorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CheckCanDeleteMonitorResponse", - "" + "CheckCanDeleteMonitorResponse" ) as CheckCanDeleteMonitorResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: CheckCanDeleteMonitorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "CheckCanDeleteMonitorResponse", - "" - ) as CheckCanDeleteMonitorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -642,37 +619,23 @@ export class MonitorsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Monitor = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Monitor", - "" + "Monitor" ) as Monitor; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -705,53 +668,25 @@ export class MonitorsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DeletedMonitor = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DeletedMonitor", - "" + "DeletedMonitor" ) as DeletedMonitor; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -782,45 +717,24 @@ export class MonitorsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Monitor = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Monitor", - "" + "Monitor" ) as Monitor; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -853,37 +767,23 @@ export class MonitorsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Array = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Array", - "" + "Array" ) as Array; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -916,37 +816,23 @@ export class MonitorsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MonitorGroupSearchResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MonitorGroupSearchResponse", - "" + "MonitorGroupSearchResponse" ) as MonitorGroupSearchResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -979,37 +865,23 @@ export class MonitorsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MonitorSearchResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MonitorSearchResponse", - "" + "MonitorSearchResponse" ) as MonitorSearchResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1040,53 +912,25 @@ export class MonitorsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Monitor = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Monitor", - "" + "Monitor" ) as Monitor; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1119,37 +963,23 @@ export class MonitorsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1180,37 +1010,23 @@ export class MonitorsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/NotebooksApi.ts b/packages/datadog-api-client-v1/apis/NotebooksApi.ts index 0e9ad54cdc94..f2ee46e01e5e 100644 --- a/packages/datadog-api-client-v1/apis/NotebooksApi.ts +++ b/packages/datadog-api-client-v1/apis/NotebooksApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { NotebookCreateRequest } from "../models/NotebookCreateRequest"; @@ -307,37 +306,23 @@ export class NotebooksApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: NotebookResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "NotebookResponse", - "" + "NotebookResponse" ) as NotebookResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -368,40 +353,20 @@ export class NotebooksApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -434,45 +399,24 @@ export class NotebooksApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: NotebookResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "NotebookResponse", - "" + "NotebookResponse" ) as NotebookResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -505,37 +449,23 @@ export class NotebooksApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: NotebooksResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "NotebooksResponse", - "" + "NotebooksResponse" ) as NotebooksResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -568,53 +498,25 @@ export class NotebooksApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: NotebookResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "NotebookResponse", - "" + "NotebookResponse" ) as NotebookResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/OrganizationsApi.ts b/packages/datadog-api-client-v1/apis/OrganizationsApi.ts index 5453f2fdf38c..94601cc11a0f 100644 --- a/packages/datadog-api-client-v1/apis/OrganizationsApi.ts +++ b/packages/datadog-api-client-v1/apis/OrganizationsApi.ts @@ -18,7 +18,6 @@ import FormData from "form-data"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { IdpResponse } from "../models/IdpResponse"; @@ -291,37 +290,23 @@ export class OrganizationsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: OrganizationCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "OrganizationCreateResponse", - "" + "OrganizationCreateResponse" ) as OrganizationCreateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -354,37 +339,23 @@ export class OrganizationsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: OrgDowngradedResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "OrgDowngradedResponse", - "" + "OrgDowngradedResponse" ) as OrgDowngradedResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -417,37 +388,23 @@ export class OrganizationsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: OrganizationResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "OrganizationResponse", - "" + "OrganizationResponse" ) as OrganizationResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -480,29 +437,19 @@ export class OrganizationsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: OrganizationListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "OrganizationListResponse", - "" + "OrganizationListResponse" ) as OrganizationListResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -535,37 +482,23 @@ export class OrganizationsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: OrganizationResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "OrganizationResponse", - "" + "OrganizationResponse" ) as OrganizationResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -598,45 +531,24 @@ export class OrganizationsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: IdpResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IdpResponse", - "" + "IdpResponse" ) as IdpResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 415 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("415", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(415, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/PagerDutyIntegrationApi.ts b/packages/datadog-api-client-v1/apis/PagerDutyIntegrationApi.ts index e95b353dc06e..4fa8b78fbd36 100644 --- a/packages/datadog-api-client-v1/apis/PagerDutyIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/PagerDutyIntegrationApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { PagerDutyService } from "../models/PagerDutyService"; @@ -212,37 +211,23 @@ export class PagerDutyIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: PagerDutyServiceName = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "PagerDutyServiceName", - "" + "PagerDutyServiceName" ) as PagerDutyServiceName; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -275,32 +260,19 @@ export class PagerDutyIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -333,37 +305,23 @@ export class PagerDutyIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: PagerDutyServiceName = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "PagerDutyServiceName", - "" + "PagerDutyServiceName" ) as PagerDutyServiceName; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -396,40 +354,20 @@ export class PagerDutyIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/SecurityMonitoringApi.ts b/packages/datadog-api-client-v1/apis/SecurityMonitoringApi.ts index 000b19ae6d7c..fb7383916ea9 100644 --- a/packages/datadog-api-client-v1/apis/SecurityMonitoringApi.ts +++ b/packages/datadog-api-client-v1/apis/SecurityMonitoringApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { AddSignalToIncidentRequest } from "../models/AddSignalToIncidentRequest"; import { APIErrorResponse } from "../models/APIErrorResponse"; @@ -207,45 +206,24 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SuccessfulSignalUpdateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SuccessfulSignalUpdateResponse", - "" + "SuccessfulSignalUpdateResponse" ) as SuccessfulSignalUpdateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -278,45 +256,24 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SuccessfulSignalUpdateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SuccessfulSignalUpdateResponse", - "" + "SuccessfulSignalUpdateResponse" ) as SuccessfulSignalUpdateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -349,45 +306,24 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SuccessfulSignalUpdateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SuccessfulSignalUpdateResponse", - "" + "SuccessfulSignalUpdateResponse" ) as SuccessfulSignalUpdateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/ServiceChecksApi.ts b/packages/datadog-api-client-v1/apis/ServiceChecksApi.ts index 6175a78cfb4f..ea7d0c908497 100644 --- a/packages/datadog-api-client-v1/apis/ServiceChecksApi.ts +++ b/packages/datadog-api-client-v1/apis/ServiceChecksApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { IntakePayloadAccepted } from "../models/IntakePayloadAccepted"; @@ -78,53 +77,25 @@ export class ServiceChecksApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("202", response.httpStatusCode)) { + if (response.httpStatusCode == 202) { const body: IntakePayloadAccepted = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IntakePayloadAccepted", - "" + "IntakePayloadAccepted" ) as IntakePayloadAccepted; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("408", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 408 || + response.httpStatusCode == 413 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(408, body); - } - if (isCodeInRange("413", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(413, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/ServiceLevelObjectiveCorrectionsApi.ts b/packages/datadog-api-client-v1/apis/ServiceLevelObjectiveCorrectionsApi.ts index dbb4da6e74ac..dd61e3bbf785 100644 --- a/packages/datadog-api-client-v1/apis/ServiceLevelObjectiveCorrectionsApi.ts +++ b/packages/datadog-api-client-v1/apis/ServiceLevelObjectiveCorrectionsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { SLOCorrectionCreateRequest } from "../models/SLOCorrectionCreateRequest"; @@ -235,45 +234,24 @@ export class ServiceLevelObjectiveCorrectionsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SLOCorrectionResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLOCorrectionResponse", - "" + "SLOCorrectionResponse" ) as SLOCorrectionResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -304,32 +282,19 @@ export class ServiceLevelObjectiveCorrectionsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -362,37 +327,23 @@ export class ServiceLevelObjectiveCorrectionsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SLOCorrectionResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLOCorrectionResponse", - "" + "SLOCorrectionResponse" ) as SLOCorrectionResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -425,29 +376,19 @@ export class ServiceLevelObjectiveCorrectionsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SLOCorrectionListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLOCorrectionListResponse", - "" + "SLOCorrectionListResponse" ) as SLOCorrectionListResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -480,45 +421,24 @@ export class ServiceLevelObjectiveCorrectionsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SLOCorrectionResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLOCorrectionResponse", - "" + "SLOCorrectionResponse" ) as SLOCorrectionResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts b/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts index 3aa0a9e690f3..5689ee8cbd76 100644 --- a/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts +++ b/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts @@ -16,7 +16,6 @@ import { import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { CheckCanDeleteSLOResponse } from "../models/CheckCanDeleteSLOResponse"; @@ -568,45 +567,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200 || response.httpStatusCode == 409) { const body: CheckCanDeleteSLOResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CheckCanDeleteSLOResponse", - "" + "CheckCanDeleteSLOResponse" ) as CheckCanDeleteSLOResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: CheckCanDeleteSLOResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "CheckCanDeleteSLOResponse", - "" - ) as CheckCanDeleteSLOResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -637,37 +614,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SLOListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLOListResponse", - "" + "SLOListResponse" ) as SLOListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -700,45 +663,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200 || response.httpStatusCode == 409) { const body: SLODeleteResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLODeleteResponse", - "" + "SLODeleteResponse" ) as SLODeleteResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: SLODeleteResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "SLODeleteResponse", - "" - ) as SLODeleteResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -771,37 +712,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SLOBulkDeleteResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLOBulkDeleteResponse", - "" + "SLOBulkDeleteResponse" ) as SLOBulkDeleteResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -832,37 +759,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SLOResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLOResponse", - "" + "SLOResponse" ) as SLOResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -895,45 +808,24 @@ export class ServiceLevelObjectivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SLOCorrectionListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLOCorrectionListResponse", - "" + "SLOCorrectionListResponse" ) as SLOCorrectionListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -966,45 +858,24 @@ export class ServiceLevelObjectivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SLOHistoryResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLOHistoryResponse", - "" + "SLOHistoryResponse" ) as SLOHistoryResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1035,45 +906,24 @@ export class ServiceLevelObjectivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SLOListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLOListResponse", - "" + "SLOListResponse" ) as SLOListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1106,37 +956,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SearchSLOResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SearchSLOResponse", - "" + "SearchSLOResponse" ) as SearchSLOResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1167,45 +1003,24 @@ export class ServiceLevelObjectivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SLOListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SLOListResponse", - "" + "SLOListResponse" ) as SLOListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/SlackIntegrationApi.ts b/packages/datadog-api-client-v1/apis/SlackIntegrationApi.ts index 7a6f412dd8c1..efae339a37a5 100644 --- a/packages/datadog-api-client-v1/apis/SlackIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/SlackIntegrationApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { SlackIntegrationChannel } from "../models/SlackIntegrationChannel"; @@ -298,45 +297,24 @@ export class SlackIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SlackIntegrationChannel = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SlackIntegrationChannel", - "" + "SlackIntegrationChannel" ) as SlackIntegrationChannel; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -369,45 +347,24 @@ export class SlackIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SlackIntegrationChannel = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SlackIntegrationChannel", - "" + "SlackIntegrationChannel" ) as SlackIntegrationChannel; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -440,45 +397,24 @@ export class SlackIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: Array = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "Array", - "" + "Array" ) as Array; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -511,40 +447,20 @@ export class SlackIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -577,45 +493,24 @@ export class SlackIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SlackIntegrationChannel = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SlackIntegrationChannel", - "" + "SlackIntegrationChannel" ) as SlackIntegrationChannel; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/SnapshotsApi.ts b/packages/datadog-api-client-v1/apis/SnapshotsApi.ts index 51caf72740f8..0da04bede4f4 100644 --- a/packages/datadog-api-client-v1/apis/SnapshotsApi.ts +++ b/packages/datadog-api-client-v1/apis/SnapshotsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { GraphSnapshot } from "../models/GraphSnapshot"; @@ -134,37 +133,23 @@ export class SnapshotsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: GraphSnapshot = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "GraphSnapshot", - "" + "GraphSnapshot" ) as GraphSnapshot; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/SyntheticsApi.ts b/packages/datadog-api-client-v1/apis/SyntheticsApi.ts index 0080b1ffafed..1f41b185030d 100644 --- a/packages/datadog-api-client-v1/apis/SyntheticsApi.ts +++ b/packages/datadog-api-client-v1/apis/SyntheticsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { SyntheticsAPITest } from "../models/SyntheticsAPITest"; @@ -1240,37 +1239,23 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsGlobalVariable = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsGlobalVariable", - "" + "SyntheticsGlobalVariable" ) as SyntheticsGlobalVariable; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1303,38 +1288,24 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsPrivateLocationCreationResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsPrivateLocationCreationResponse", - "" + "SyntheticsPrivateLocationCreationResponse" ) as SyntheticsPrivateLocationCreationResponse; return body; } - if (isCodeInRange("402", response.httpStatusCode)) { + if ( + response.httpStatusCode == 402 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(402, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1368,45 +1339,24 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsAPITest = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsAPITest", - "" + "SyntheticsAPITest" ) as SyntheticsAPITest; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 402 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("402", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(402, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1439,45 +1389,24 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsBrowserTest = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsBrowserTest", - "" + "SyntheticsBrowserTest" ) as SyntheticsBrowserTest; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 402 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("402", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(402, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1508,40 +1437,20 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1572,24 +1481,15 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1622,45 +1522,24 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsDeleteTestsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsDeleteTestsResponse", - "" + "SyntheticsDeleteTestsResponse" ) as SyntheticsDeleteTestsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1693,37 +1572,23 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsGlobalVariable = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsGlobalVariable", - "" + "SyntheticsGlobalVariable" ) as SyntheticsGlobalVariable; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1756,37 +1621,23 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsAPITest = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsAPITest", - "" + "SyntheticsAPITest" ) as SyntheticsAPITest; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1819,38 +1670,24 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsGetAPITestLatestResultsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsGetAPITestLatestResultsResponse", - "" + "SyntheticsGetAPITestLatestResultsResponse" ) as SyntheticsGetAPITestLatestResultsResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1884,37 +1721,23 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsAPITestResultFull = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsAPITestResultFull", - "" + "SyntheticsAPITestResultFull" ) as SyntheticsAPITestResultFull; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1947,37 +1770,23 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsBrowserTest = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsBrowserTest", - "" + "SyntheticsBrowserTest" ) as SyntheticsBrowserTest; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2010,38 +1819,24 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsGetBrowserTestLatestResultsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsGetBrowserTestLatestResultsResponse", - "" + "SyntheticsGetBrowserTestLatestResultsResponse" ) as SyntheticsGetBrowserTestLatestResultsResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2075,38 +1870,24 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsBrowserTestResultFull = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsBrowserTestResultFull", - "" + "SyntheticsBrowserTestResultFull" ) as SyntheticsBrowserTestResultFull; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2140,37 +1921,23 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsGlobalVariable = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsGlobalVariable", - "" + "SyntheticsGlobalVariable" ) as SyntheticsGlobalVariable; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2203,29 +1970,19 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsPrivateLocation = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsPrivateLocation", - "" + "SyntheticsPrivateLocation" ) as SyntheticsPrivateLocation; return body; } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2258,29 +2015,19 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsBatchDetails = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsBatchDetails", - "" + "SyntheticsBatchDetails" ) as SyntheticsBatchDetails; return body; } - if (isCodeInRange("404", response.httpStatusCode)) { + if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2313,37 +2060,23 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsTestDetails = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsTestDetails", - "" + "SyntheticsTestDetails" ) as SyntheticsTestDetails; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2376,30 +2109,20 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsListGlobalVariablesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsListGlobalVariablesResponse", - "" + "SyntheticsListGlobalVariablesResponse" ) as SyntheticsListGlobalVariablesResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2433,21 +2156,19 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsLocations = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsLocations", - "" + "SyntheticsLocations" ) as SyntheticsLocations; return body; } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2480,37 +2201,23 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsListTestsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsListTestsResponse", - "" + "SyntheticsListTestsResponse" ) as SyntheticsListTestsResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2543,30 +2250,20 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsTriggerCITestsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsTriggerCITestsResponse", - "" + "SyntheticsTriggerCITestsResponse" ) as SyntheticsTriggerCITestsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2600,30 +2297,20 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsTriggerCITestsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsTriggerCITestsResponse", - "" + "SyntheticsTriggerCITestsResponse" ) as SyntheticsTriggerCITestsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2657,45 +2344,24 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsAPITest = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsAPITest", - "" + "SyntheticsAPITest" ) as SyntheticsAPITest; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2728,45 +2394,24 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsBrowserTest = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsBrowserTest", - "" + "SyntheticsBrowserTest" ) as SyntheticsBrowserTest; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2799,29 +2444,19 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SyntheticsPrivateLocation = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsPrivateLocation", - "" + "SyntheticsPrivateLocation" ) as SyntheticsPrivateLocation; return body; } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2854,45 +2489,24 @@ export class SyntheticsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: boolean = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "boolean", - "" + "boolean" ) as boolean; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/TagsApi.ts b/packages/datadog-api-client-v1/apis/TagsApi.ts index d2a529cd2779..18b3a419325d 100644 --- a/packages/datadog-api-client-v1/apis/TagsApi.ts +++ b/packages/datadog-api-client-v1/apis/TagsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { HostTags } from "../models/HostTags"; @@ -288,37 +287,23 @@ export class TagsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: HostTags = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostTags", - "" + "HostTags" ) as HostTags; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -349,32 +334,19 @@ export class TagsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -405,37 +377,23 @@ export class TagsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: HostTags = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostTags", - "" + "HostTags" ) as HostTags; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -466,37 +424,23 @@ export class TagsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: TagToHosts = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "TagToHosts", - "" + "TagToHosts" ) as TagToHosts; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -527,37 +471,23 @@ export class TagsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: HostTags = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HostTags", - "" + "HostTags" ) as HostTags; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts b/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts index eb7cb309236f..f9f82de565d2 100644 --- a/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts +++ b/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { HourlyUsageAttributionResponse } from "../models/HourlyUsageAttributionResponse"; @@ -2213,29 +2212,19 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageCustomReportsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageCustomReportsResponse", - "" + "UsageCustomReportsResponse" ) as UsageCustomReportsResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2268,29 +2257,19 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: HourlyUsageAttributionResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HourlyUsageAttributionResponse", - "" + "HourlyUsageAttributionResponse" ) as HourlyUsageAttributionResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2323,38 +2302,24 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageIncidentManagementResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageIncidentManagementResponse", - "" + "UsageIncidentManagementResponse" ) as UsageIncidentManagementResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2388,37 +2353,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageIngestedSpansResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageIngestedSpansResponse", - "" + "UsageIngestedSpansResponse" ) as UsageIngestedSpansResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2451,29 +2402,19 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageCustomReportsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageCustomReportsResponse", - "" + "UsageCustomReportsResponse" ) as UsageCustomReportsResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2506,30 +2447,20 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MonthlyUsageAttributionResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MonthlyUsageAttributionResponse", - "" + "MonthlyUsageAttributionResponse" ) as MonthlyUsageAttributionResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2563,38 +2494,24 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageSpecifiedCustomReportsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageSpecifiedCustomReportsResponse", - "" + "UsageSpecifiedCustomReportsResponse" ) as UsageSpecifiedCustomReportsResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2628,46 +2545,25 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageSpecifiedCustomReportsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageSpecifiedCustomReportsResponse", - "" + "UsageSpecifiedCustomReportsResponse" ) as UsageSpecifiedCustomReportsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2701,37 +2597,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageAnalyzedLogsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageAnalyzedLogsResponse", - "" + "UsageAnalyzedLogsResponse" ) as UsageAnalyzedLogsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2764,29 +2646,19 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageAttributionResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageAttributionResponse", - "" + "UsageAttributionResponse" ) as UsageAttributionResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2819,37 +2691,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageAuditLogsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageAuditLogsResponse", - "" + "UsageAuditLogsResponse" ) as UsageAuditLogsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2882,37 +2740,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageBillableSummaryResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageBillableSummaryResponse", - "" + "UsageBillableSummaryResponse" ) as UsageBillableSummaryResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2945,37 +2789,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageCIVisibilityResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageCIVisibilityResponse", - "" + "UsageCIVisibilityResponse" ) as UsageCIVisibilityResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3008,38 +2838,24 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageCloudSecurityPostureManagementResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageCloudSecurityPostureManagementResponse", - "" + "UsageCloudSecurityPostureManagementResponse" ) as UsageCloudSecurityPostureManagementResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3073,37 +2889,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageCWSResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageCWSResponse", - "" + "UsageCWSResponse" ) as UsageCWSResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3136,37 +2938,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageDBMResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageDBMResponse", - "" + "UsageDBMResponse" ) as UsageDBMResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3199,37 +2987,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageFargateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageFargateResponse", - "" + "UsageFargateResponse" ) as UsageFargateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3262,37 +3036,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageHostsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageHostsResponse", - "" + "UsageHostsResponse" ) as UsageHostsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3325,37 +3085,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageIndexedSpansResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageIndexedSpansResponse", - "" + "UsageIndexedSpansResponse" ) as UsageIndexedSpansResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3388,37 +3134,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageIoTResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageIoTResponse", - "" + "UsageIoTResponse" ) as UsageIoTResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3451,37 +3183,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageLambdaResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageLambdaResponse", - "" + "UsageLambdaResponse" ) as UsageLambdaResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3514,37 +3232,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageLogsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageLogsResponse", - "" + "UsageLogsResponse" ) as UsageLogsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3577,37 +3281,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageLogsByIndexResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageLogsByIndexResponse", - "" + "UsageLogsByIndexResponse" ) as UsageLogsByIndexResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3640,37 +3330,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageLogsByRetentionResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageLogsByRetentionResponse", - "" + "UsageLogsByRetentionResponse" ) as UsageLogsByRetentionResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3703,37 +3379,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageNetworkFlowsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageNetworkFlowsResponse", - "" + "UsageNetworkFlowsResponse" ) as UsageNetworkFlowsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3766,37 +3428,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageNetworkHostsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageNetworkHostsResponse", - "" + "UsageNetworkHostsResponse" ) as UsageNetworkHostsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3829,37 +3477,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageOnlineArchiveResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageOnlineArchiveResponse", - "" + "UsageOnlineArchiveResponse" ) as UsageOnlineArchiveResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3892,37 +3526,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageProfilingResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageProfilingResponse", - "" + "UsageProfilingResponse" ) as UsageProfilingResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3955,37 +3575,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageRumSessionsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageRumSessionsResponse", - "" + "UsageRumSessionsResponse" ) as UsageRumSessionsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -4018,37 +3624,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageRumUnitsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageRumUnitsResponse", - "" + "UsageRumUnitsResponse" ) as UsageRumUnitsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -4081,37 +3673,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageSDSResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageSDSResponse", - "" + "UsageSDSResponse" ) as UsageSDSResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -4144,37 +3722,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageSNMPResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageSNMPResponse", - "" + "UsageSNMPResponse" ) as UsageSNMPResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -4207,37 +3771,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageSummaryResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageSummaryResponse", - "" + "UsageSummaryResponse" ) as UsageSummaryResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -4270,37 +3820,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageSyntheticsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageSyntheticsResponse", - "" + "UsageSyntheticsResponse" ) as UsageSyntheticsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -4333,37 +3869,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageSyntheticsAPIResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageSyntheticsAPIResponse", - "" + "UsageSyntheticsAPIResponse" ) as UsageSyntheticsAPIResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -4396,37 +3918,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageSyntheticsBrowserResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageSyntheticsBrowserResponse", - "" + "UsageSyntheticsBrowserResponse" ) as UsageSyntheticsBrowserResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -4459,37 +3967,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageTimeseriesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageTimeseriesResponse", - "" + "UsageTimeseriesResponse" ) as UsageTimeseriesResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -4522,37 +4016,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageTopAvgMetricsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageTopAvgMetricsResponse", - "" + "UsageTopAvgMetricsResponse" ) as UsageTopAvgMetricsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/UsersApi.ts b/packages/datadog-api-client-v1/apis/UsersApi.ts index ed4fca371d9b..089ddc14c2dd 100644 --- a/packages/datadog-api-client-v1/apis/UsersApi.ts +++ b/packages/datadog-api-client-v1/apis/UsersApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { User } from "../models/User"; @@ -233,45 +232,24 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UserResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserResponse", - "" + "UserResponse" ) as UserResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -304,45 +282,24 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UserDisableResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserDisableResponse", - "" + "UserDisableResponse" ) as UserDisableResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -373,37 +330,23 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UserResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserResponse", - "" + "UserResponse" ) as UserResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -434,29 +377,19 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UserListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserListResponse", - "" + "UserListResponse" ) as UserListResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -487,45 +420,24 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UserResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserResponse", - "" + "UserResponse" ) as UserResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/WebhooksIntegrationApi.ts b/packages/datadog-api-client-v1/apis/WebhooksIntegrationApi.ts index b590da577767..e8339a1eeffb 100644 --- a/packages/datadog-api-client-v1/apis/WebhooksIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/WebhooksIntegrationApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { WebhooksIntegration } from "../models/WebhooksIntegration"; @@ -393,37 +392,23 @@ export class WebhooksIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: WebhooksIntegration = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "WebhooksIntegration", - "" + "WebhooksIntegration" ) as WebhooksIntegration; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -456,38 +441,24 @@ export class WebhooksIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: WebhooksIntegrationCustomVariableResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "WebhooksIntegrationCustomVariableResponse", - "" + "WebhooksIntegrationCustomVariableResponse" ) as WebhooksIntegrationCustomVariableResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -521,32 +492,19 @@ export class WebhooksIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -579,32 +537,19 @@ export class WebhooksIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -637,45 +582,24 @@ export class WebhooksIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: WebhooksIntegration = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "WebhooksIntegration", - "" + "WebhooksIntegration" ) as WebhooksIntegration; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -708,46 +632,25 @@ export class WebhooksIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: WebhooksIntegrationCustomVariableResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "WebhooksIntegrationCustomVariableResponse", - "" + "WebhooksIntegrationCustomVariableResponse" ) as WebhooksIntegrationCustomVariableResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -781,45 +684,24 @@ export class WebhooksIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: WebhooksIntegration = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "WebhooksIntegration", - "" + "WebhooksIntegration" ) as WebhooksIntegration; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -852,46 +734,25 @@ export class WebhooksIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: WebhooksIntegrationCustomVariableResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "WebhooksIntegrationCustomVariableResponse", - "" + "WebhooksIntegrationCustomVariableResponse" ) as WebhooksIntegrationCustomVariableResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/AuditApi.ts b/packages/datadog-api-client-v2/apis/AuditApi.ts index d2a788d6c2ba..5fa8c075a31e 100644 --- a/packages/datadog-api-client-v2/apis/AuditApi.ts +++ b/packages/datadog-api-client-v2/apis/AuditApi.ts @@ -12,7 +12,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { AuditLogsEvent } from "../models/AuditLogsEvent"; @@ -143,37 +142,23 @@ export class AuditApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AuditLogsEventsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AuditLogsEventsResponse", - "" + "AuditLogsEventsResponse" ) as AuditLogsEventsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -206,37 +191,23 @@ export class AuditApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AuditLogsEventsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AuditLogsEventsResponse", - "" + "AuditLogsEventsResponse" ) as AuditLogsEventsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/AuthNMappingsApi.ts b/packages/datadog-api-client-v2/apis/AuthNMappingsApi.ts index ddefbc5e092b..bc041217b29c 100644 --- a/packages/datadog-api-client-v2/apis/AuthNMappingsApi.ts +++ b/packages/datadog-api-client-v2/apis/AuthNMappingsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { AuthNMappingCreateRequest } from "../models/AuthNMappingCreateRequest"; @@ -271,45 +270,24 @@ export class AuthNMappingsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AuthNMappingResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AuthNMappingResponse", - "" + "AuthNMappingResponse" ) as AuthNMappingResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -340,32 +318,19 @@ export class AuthNMappingsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -398,37 +363,23 @@ export class AuthNMappingsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AuthNMappingResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AuthNMappingResponse", - "" + "AuthNMappingResponse" ) as AuthNMappingResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -461,29 +412,19 @@ export class AuthNMappingsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AuthNMappingsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AuthNMappingsResponse", - "" + "AuthNMappingsResponse" ) as AuthNMappingsResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -516,61 +457,26 @@ export class AuthNMappingsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: AuthNMappingResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "AuthNMappingResponse", - "" + "AuthNMappingResponse" ) as AuthNMappingResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 409 || + response.httpStatusCode == 422 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("422", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(422, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/CloudWorkloadSecurityApi.ts b/packages/datadog-api-client-v2/apis/CloudWorkloadSecurityApi.ts index 5d7a2e812482..5aec938895d6 100644 --- a/packages/datadog-api-client-v2/apis/CloudWorkloadSecurityApi.ts +++ b/packages/datadog-api-client-v2/apis/CloudWorkloadSecurityApi.ts @@ -16,7 +16,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { CloudWorkloadSecurityAgentRuleCreateRequest } from "../models/CloudWorkloadSecurityAgentRuleCreateRequest"; @@ -277,46 +276,25 @@ export class CloudWorkloadSecurityApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: CloudWorkloadSecurityAgentRuleResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CloudWorkloadSecurityAgentRuleResponse", - "" + "CloudWorkloadSecurityAgentRuleResponse" ) as CloudWorkloadSecurityAgentRuleResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -350,32 +328,19 @@ export class CloudWorkloadSecurityApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -408,25 +373,16 @@ export class CloudWorkloadSecurityApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: HttpFile = (await response.getBodyAsFile()) as HttpFile; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -456,38 +412,24 @@ export class CloudWorkloadSecurityApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: CloudWorkloadSecurityAgentRuleResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CloudWorkloadSecurityAgentRuleResponse", - "" + "CloudWorkloadSecurityAgentRuleResponse" ) as CloudWorkloadSecurityAgentRuleResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -521,30 +463,20 @@ export class CloudWorkloadSecurityApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: CloudWorkloadSecurityAgentRulesListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CloudWorkloadSecurityAgentRulesListResponse", - "" + "CloudWorkloadSecurityAgentRulesListResponse" ) as CloudWorkloadSecurityAgentRulesListResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -578,54 +510,26 @@ export class CloudWorkloadSecurityApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: CloudWorkloadSecurityAgentRuleResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CloudWorkloadSecurityAgentRuleResponse", - "" + "CloudWorkloadSecurityAgentRuleResponse" ) as CloudWorkloadSecurityAgentRuleResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/DashboardListsApi.ts b/packages/datadog-api-client-v2/apis/DashboardListsApi.ts index a118db6bc6da..c9e53fbd816a 100644 --- a/packages/datadog-api-client-v2/apis/DashboardListsApi.ts +++ b/packages/datadog-api-client-v2/apis/DashboardListsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { DashboardListAddItemsRequest } from "../models/DashboardListAddItemsRequest"; @@ -248,45 +247,24 @@ export class DashboardListsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DashboardListAddItemsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DashboardListAddItemsResponse", - "" + "DashboardListAddItemsResponse" ) as DashboardListAddItemsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -319,46 +297,25 @@ export class DashboardListsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DashboardListDeleteItemsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DashboardListDeleteItemsResponse", - "" + "DashboardListDeleteItemsResponse" ) as DashboardListDeleteItemsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -392,37 +349,23 @@ export class DashboardListsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DashboardListItems = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DashboardListItems", - "" + "DashboardListItems" ) as DashboardListItems; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -455,46 +398,25 @@ export class DashboardListsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: DashboardListUpdateItemsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "DashboardListUpdateItemsResponse", - "" + "DashboardListUpdateItemsResponse" ) as DashboardListUpdateItemsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/EventsApi.ts b/packages/datadog-api-client-v2/apis/EventsApi.ts index cc65bbf36529..8b3b98dbc526 100644 --- a/packages/datadog-api-client-v2/apis/EventsApi.ts +++ b/packages/datadog-api-client-v2/apis/EventsApi.ts @@ -13,7 +13,6 @@ import { import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { EventResponse } from "../models/EventResponse"; @@ -156,37 +155,23 @@ export class EventsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: EventsListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "EventsListResponse", - "" + "EventsListResponse" ) as EventsListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -219,37 +204,23 @@ export class EventsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: EventsListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "EventsListResponse", - "" + "EventsListResponse" ) as EventsListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/IncidentServicesApi.ts b/packages/datadog-api-client-v2/apis/IncidentServicesApi.ts index 706cea0f6602..00ecc57cd490 100644 --- a/packages/datadog-api-client-v2/apis/IncidentServicesApi.ts +++ b/packages/datadog-api-client-v2/apis/IncidentServicesApi.ts @@ -16,7 +16,6 @@ import { import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { IncidentRelatedObject } from "../models/IncidentRelatedObject"; @@ -306,53 +305,25 @@ export class IncidentServicesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: IncidentServiceResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentServiceResponse", - "" + "IncidentServiceResponse" ) as IncidentServiceResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -383,48 +354,21 @@ export class IncidentServicesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -457,53 +401,25 @@ export class IncidentServicesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: IncidentServiceResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentServiceResponse", - "" + "IncidentServiceResponse" ) as IncidentServiceResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -536,53 +452,25 @@ export class IncidentServicesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: IncidentServicesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentServicesResponse", - "" + "IncidentServicesResponse" ) as IncidentServicesResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -615,53 +503,25 @@ export class IncidentServicesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: IncidentServiceResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentServiceResponse", - "" + "IncidentServiceResponse" ) as IncidentServiceResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/IncidentTeamsApi.ts b/packages/datadog-api-client-v2/apis/IncidentTeamsApi.ts index 5b23936efc74..9318b162f998 100644 --- a/packages/datadog-api-client-v2/apis/IncidentTeamsApi.ts +++ b/packages/datadog-api-client-v2/apis/IncidentTeamsApi.ts @@ -16,7 +16,6 @@ import { import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { IncidentRelatedObject } from "../models/IncidentRelatedObject"; @@ -306,53 +305,25 @@ export class IncidentTeamsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: IncidentTeamResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentTeamResponse", - "" + "IncidentTeamResponse" ) as IncidentTeamResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -383,48 +354,21 @@ export class IncidentTeamsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -457,53 +401,25 @@ export class IncidentTeamsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: IncidentTeamResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentTeamResponse", - "" + "IncidentTeamResponse" ) as IncidentTeamResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -536,53 +452,25 @@ export class IncidentTeamsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: IncidentTeamsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentTeamsResponse", - "" + "IncidentTeamsResponse" ) as IncidentTeamsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -615,53 +503,25 @@ export class IncidentTeamsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: IncidentTeamResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentTeamResponse", - "" + "IncidentTeamResponse" ) as IncidentTeamResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/IncidentsApi.ts b/packages/datadog-api-client-v2/apis/IncidentsApi.ts index c90ffcbf849c..a88122e467cc 100644 --- a/packages/datadog-api-client-v2/apis/IncidentsApi.ts +++ b/packages/datadog-api-client-v2/apis/IncidentsApi.ts @@ -16,7 +16,6 @@ import { import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { IncidentCreateRequest } from "../models/IncidentCreateRequest"; @@ -309,53 +308,25 @@ export class IncidentsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: IncidentResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentResponse", - "" + "IncidentResponse" ) as IncidentResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -386,48 +357,21 @@ export class IncidentsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -460,53 +404,25 @@ export class IncidentsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: IncidentResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentResponse", - "" + "IncidentResponse" ) as IncidentResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -539,53 +455,25 @@ export class IncidentsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: IncidentsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentsResponse", - "" + "IncidentsResponse" ) as IncidentsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -618,53 +506,25 @@ export class IncidentsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: IncidentResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IncidentResponse", - "" + "IncidentResponse" ) as IncidentResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/KeyManagementApi.ts b/packages/datadog-api-client-v2/apis/KeyManagementApi.ts index 9da74df4f212..2fb4fc5d7c0c 100644 --- a/packages/datadog-api-client-v2/apis/KeyManagementApi.ts +++ b/packages/datadog-api-client-v2/apis/KeyManagementApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { APIKeyCreateRequest } from "../models/APIKeyCreateRequest"; @@ -763,37 +762,23 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: APIKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIKeyResponse", - "" + "APIKeyResponse" ) as APIKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -826,37 +811,23 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: ApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationKeyResponse", - "" + "ApplicationKeyResponse" ) as ApplicationKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -887,32 +858,19 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -943,32 +901,19 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1001,32 +946,19 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1057,37 +989,23 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: APIKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIKeyResponse", - "" + "APIKeyResponse" ) as APIKeyResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1120,45 +1038,24 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationKeyResponse", - "" + "ApplicationKeyResponse" ) as ApplicationKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1191,37 +1088,23 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationKeyResponse", - "" + "ApplicationKeyResponse" ) as ApplicationKeyResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1254,37 +1137,23 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: APIKeysResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIKeysResponse", - "" + "APIKeysResponse" ) as APIKeysResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1317,45 +1186,24 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ListApplicationKeysResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ListApplicationKeysResponse", - "" + "ListApplicationKeysResponse" ) as ListApplicationKeysResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1388,45 +1236,24 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ListApplicationKeysResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ListApplicationKeysResponse", - "" + "ListApplicationKeysResponse" ) as ListApplicationKeysResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1459,45 +1286,24 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: APIKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIKeyResponse", - "" + "APIKeyResponse" ) as APIKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1530,45 +1336,24 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationKeyResponse", - "" + "ApplicationKeyResponse" ) as ApplicationKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1601,45 +1386,24 @@ export class KeyManagementApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationKeyResponse", - "" + "ApplicationKeyResponse" ) as ApplicationKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/LogsApi.ts b/packages/datadog-api-client-v2/apis/LogsApi.ts index 55bb0219f06e..20b227a7760b 100644 --- a/packages/datadog-api-client-v2/apis/LogsApi.ts +++ b/packages/datadog-api-client-v2/apis/LogsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { ContentEncoding } from "../models/ContentEncoding"; @@ -263,37 +262,23 @@ export class LogsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsAggregateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAggregateResponse", - "" + "LogsAggregateResponse" ) as LogsAggregateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -324,37 +309,23 @@ export class LogsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsListResponse", - "" + "LogsListResponse" ) as LogsListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -387,37 +358,23 @@ export class LogsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsListResponse", - "" + "LogsListResponse" ) as LogsListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -448,77 +405,28 @@ export class LogsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("202", response.httpStatusCode)) { + if (response.httpStatusCode == 202) { const body: any = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "any", - "" + "any" ) as any; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: HTTPLogErrors = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "HTTPLogErrors", - "" - ) as HTTPLogErrors; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { - const body: HTTPLogErrors = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "HTTPLogErrors", - "" - ) as HTTPLogErrors; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: HTTPLogErrors = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "HTTPLogErrors", - "" - ) as HTTPLogErrors; - throw new ApiException(403, body); - } - if (isCodeInRange("408", response.httpStatusCode)) { - const body: HTTPLogErrors = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "HTTPLogErrors", - "" - ) as HTTPLogErrors; - throw new ApiException(408, body); - } - if (isCodeInRange("413", response.httpStatusCode)) { - const body: HTTPLogErrors = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "HTTPLogErrors", - "" - ) as HTTPLogErrors; - throw new ApiException(413, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 408 || + response.httpStatusCode == 413 || + response.httpStatusCode == 429 || + response.httpStatusCode == 500 || + response.httpStatusCode == 503 + ) { const body: HTTPLogErrors = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HTTPLogErrors", - "" - ) as HTTPLogErrors; - throw new ApiException(429, body); - } - if (isCodeInRange("500", response.httpStatusCode)) { - const body: HTTPLogErrors = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "HTTPLogErrors", - "" - ) as HTTPLogErrors; - throw new ApiException(500, body); - } - if (isCodeInRange("503", response.httpStatusCode)) { - const body: HTTPLogErrors = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "HTTPLogErrors", - "" + "HTTPLogErrors" ) as HTTPLogErrors; - throw new ApiException(503, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/LogsArchivesApi.ts b/packages/datadog-api-client-v2/apis/LogsArchivesApi.ts index 7464719b09fe..f095da14703a 100644 --- a/packages/datadog-api-client-v2/apis/LogsArchivesApi.ts +++ b/packages/datadog-api-client-v2/apis/LogsArchivesApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { LogsArchive } from "../models/LogsArchive"; @@ -457,40 +456,20 @@ export class LogsArchivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -523,37 +502,23 @@ export class LogsArchivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsArchive = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsArchive", - "" + "LogsArchive" ) as LogsArchive; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -584,40 +549,20 @@ export class LogsArchivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -648,45 +593,24 @@ export class LogsArchivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsArchive = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsArchive", - "" + "LogsArchive" ) as LogsArchive; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -719,29 +643,19 @@ export class LogsArchivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsArchiveOrder = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsArchiveOrder", - "" + "LogsArchiveOrder" ) as LogsArchiveOrder; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -774,45 +688,24 @@ export class LogsArchivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RolesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RolesResponse", - "" + "RolesResponse" ) as RolesResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -845,29 +738,19 @@ export class LogsArchivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsArchives = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsArchives", - "" + "LogsArchives" ) as LogsArchives; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -898,40 +781,20 @@ export class LogsArchivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -964,45 +827,24 @@ export class LogsArchivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsArchive = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsArchive", - "" + "LogsArchive" ) as LogsArchive; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1035,45 +877,24 @@ export class LogsArchivesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsArchiveOrder = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsArchiveOrder", - "" + "LogsArchiveOrder" ) as LogsArchiveOrder; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("422", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 422 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(422, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/LogsMetricsApi.ts b/packages/datadog-api-client-v2/apis/LogsMetricsApi.ts index 3d14b313e7c9..2b8d85f18cdf 100644 --- a/packages/datadog-api-client-v2/apis/LogsMetricsApi.ts +++ b/packages/datadog-api-client-v2/apis/LogsMetricsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { LogsMetricCreateRequest } from "../models/LogsMetricCreateRequest"; @@ -237,45 +236,24 @@ export class LogsMetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsMetricResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsMetricResponse", - "" + "LogsMetricResponse" ) as LogsMetricResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -306,32 +284,19 @@ export class LogsMetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -364,37 +329,23 @@ export class LogsMetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsMetricResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsMetricResponse", - "" + "LogsMetricResponse" ) as LogsMetricResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -427,29 +378,19 @@ export class LogsMetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsMetricsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsMetricsResponse", - "" + "LogsMetricsResponse" ) as LogsMetricsResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -482,45 +423,24 @@ export class LogsMetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: LogsMetricResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "LogsMetricResponse", - "" + "LogsMetricResponse" ) as LogsMetricResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/MetricsApi.ts b/packages/datadog-api-client-v2/apis/MetricsApi.ts index 10d58a622a59..67937734398d 100644 --- a/packages/datadog-api-client-v2/apis/MetricsApi.ts +++ b/packages/datadog-api-client-v2/apis/MetricsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { IntakePayloadAccepted } from "../models/IntakePayloadAccepted"; @@ -655,45 +654,24 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("202", response.httpStatusCode)) { + if (response.httpStatusCode == 202) { const body: MetricBulkTagConfigResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricBulkTagConfigResponse", - "" + "MetricBulkTagConfigResponse" ) as MetricBulkTagConfigResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -726,45 +704,24 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: MetricTagConfigurationResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricTagConfigurationResponse", - "" + "MetricTagConfigurationResponse" ) as MetricTagConfigurationResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -797,45 +754,24 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("202", response.httpStatusCode)) { + if (response.httpStatusCode == 202) { const body: MetricBulkTagConfigResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricBulkTagConfigResponse", - "" + "MetricBulkTagConfigResponse" ) as MetricBulkTagConfigResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -868,32 +804,19 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -926,45 +849,24 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricEstimateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricEstimateResponse", - "" + "MetricEstimateResponse" ) as MetricEstimateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -997,46 +899,25 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricSuggestedTagsAndAggregationsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricSuggestedTagsAndAggregationsResponse", - "" + "MetricSuggestedTagsAndAggregationsResponse" ) as MetricSuggestedTagsAndAggregationsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1070,37 +951,23 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricTagConfigurationResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricTagConfigurationResponse", - "" + "MetricTagConfigurationResponse" ) as MetricTagConfigurationResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1133,38 +1000,24 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricsAndMetricTagConfigurationsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricsAndMetricTagConfigurationsResponse", - "" + "MetricsAndMetricTagConfigurationsResponse" ) as MetricsAndMetricTagConfigurationsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1198,45 +1051,24 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricAllTagsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricAllTagsResponse", - "" + "MetricAllTagsResponse" ) as MetricAllTagsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1269,45 +1101,24 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricVolumesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricVolumesResponse", - "" + "MetricVolumesResponse" ) as MetricVolumesResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1340,53 +1151,25 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("202", response.httpStatusCode)) { + if (response.httpStatusCode == 202) { const body: IntakePayloadAccepted = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "IntakePayloadAccepted", - "" + "IntakePayloadAccepted" ) as IntakePayloadAccepted; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 408 || + response.httpStatusCode == 413 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("408", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(408, body); - } - if (isCodeInRange("413", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(413, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1419,45 +1202,24 @@ export class MetricsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: MetricTagConfigurationResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "MetricTagConfigurationResponse", - "" + "MetricTagConfigurationResponse" ) as MetricTagConfigurationResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 422 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("422", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(422, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/OpsgenieIntegrationApi.ts b/packages/datadog-api-client-v2/apis/OpsgenieIntegrationApi.ts index e804e0fdcb23..6516497e56fc 100644 --- a/packages/datadog-api-client-v2/apis/OpsgenieIntegrationApi.ts +++ b/packages/datadog-api-client-v2/apis/OpsgenieIntegrationApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { OpsgenieServiceCreateRequest } from "../models/OpsgenieServiceCreateRequest"; @@ -238,45 +237,24 @@ export class OpsgenieIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: OpsgenieServiceResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "OpsgenieServiceResponse", - "" + "OpsgenieServiceResponse" ) as OpsgenieServiceResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -307,40 +285,20 @@ export class OpsgenieIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -373,53 +331,25 @@ export class OpsgenieIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: OpsgenieServiceResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "OpsgenieServiceResponse", - "" + "OpsgenieServiceResponse" ) as OpsgenieServiceResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -452,29 +382,19 @@ export class OpsgenieIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: OpsgenieServicesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "OpsgenieServicesResponse", - "" + "OpsgenieServicesResponse" ) as OpsgenieServicesResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -507,53 +427,25 @@ export class OpsgenieIntegrationApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: OpsgenieServiceResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "OpsgenieServiceResponse", - "" + "OpsgenieServiceResponse" ) as OpsgenieServiceResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/OrganizationsApi.ts b/packages/datadog-api-client-v2/apis/OrganizationsApi.ts index f5ee29429c30..703a91f2fd42 100644 --- a/packages/datadog-api-client-v2/apis/OrganizationsApi.ts +++ b/packages/datadog-api-client-v2/apis/OrganizationsApi.ts @@ -15,7 +15,6 @@ import FormData from "form-data"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; @@ -67,32 +66,19 @@ export class OrganizationsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { return; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/ProcessesApi.ts b/packages/datadog-api-client-v2/apis/ProcessesApi.ts index 7fb478c3cc34..34f9d205d9c8 100644 --- a/packages/datadog-api-client-v2/apis/ProcessesApi.ts +++ b/packages/datadog-api-client-v2/apis/ProcessesApi.ts @@ -12,7 +12,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { ProcessSummariesResponse } from "../models/ProcessSummariesResponse"; @@ -104,37 +103,23 @@ export class ProcessesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ProcessSummariesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ProcessSummariesResponse", - "" + "ProcessSummariesResponse" ) as ProcessSummariesResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/RUMApi.ts b/packages/datadog-api-client-v2/apis/RUMApi.ts index 10ada4419760..866430c54a81 100644 --- a/packages/datadog-api-client-v2/apis/RUMApi.ts +++ b/packages/datadog-api-client-v2/apis/RUMApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { RUMAggregateRequest } from "../models/RUMAggregateRequest"; @@ -402,37 +401,23 @@ export class RUMApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RUMAnalyticsAggregateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RUMAnalyticsAggregateResponse", - "" + "RUMAnalyticsAggregateResponse" ) as RUMAnalyticsAggregateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -465,29 +450,19 @@ export class RUMApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RUMApplicationResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RUMApplicationResponse", - "" + "RUMApplicationResponse" ) as RUMApplicationResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -518,24 +493,15 @@ export class RUMApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -568,29 +534,19 @@ export class RUMApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RUMApplicationResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RUMApplicationResponse", - "" + "RUMApplicationResponse" ) as RUMApplicationResponse; return body; } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -623,29 +579,19 @@ export class RUMApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RUMApplicationsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RUMApplicationsResponse", - "" + "RUMApplicationsResponse" ) as RUMApplicationsResponse; return body; } - if (isCodeInRange("404", response.httpStatusCode)) { + if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -678,37 +624,23 @@ export class RUMApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RUMEventsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RUMEventsResponse", - "" + "RUMEventsResponse" ) as RUMEventsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -741,37 +673,23 @@ export class RUMApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RUMEventsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RUMEventsResponse", - "" + "RUMEventsResponse" ) as RUMEventsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -804,45 +722,24 @@ export class RUMApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RUMApplicationResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RUMApplicationResponse", - "" + "RUMApplicationResponse" ) as RUMApplicationResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 404 || + response.httpStatusCode == 422 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("422", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(422, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/RolesApi.ts b/packages/datadog-api-client-v2/apis/RolesApi.ts index c986a68902cf..3a3b82003dfa 100644 --- a/packages/datadog-api-client-v2/apis/RolesApi.ts +++ b/packages/datadog-api-client-v2/apis/RolesApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { PermissionsResponse } from "../models/PermissionsResponse"; @@ -688,45 +687,24 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: PermissionsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "PermissionsResponse", - "" + "PermissionsResponse" ) as PermissionsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -759,45 +737,24 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsersResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsersResponse", - "" + "UsersResponse" ) as UsersResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -828,53 +785,25 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RoleResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RoleResponse", - "" + "RoleResponse" ) as RoleResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -907,37 +836,23 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RoleCreateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RoleCreateResponse", - "" + "RoleCreateResponse" ) as RoleCreateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -968,32 +883,19 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1024,37 +926,23 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RoleResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RoleResponse", - "" + "RoleResponse" ) as RoleResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1087,37 +975,23 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: PermissionsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "PermissionsResponse", - "" + "PermissionsResponse" ) as PermissionsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1150,37 +1024,23 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: PermissionsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "PermissionsResponse", - "" + "PermissionsResponse" ) as PermissionsResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1211,29 +1071,19 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RolesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RolesResponse", - "" + "RolesResponse" ) as RolesResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1266,37 +1116,23 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsersResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsersResponse", - "" + "UsersResponse" ) as UsersResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1329,45 +1165,24 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: PermissionsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "PermissionsResponse", - "" + "PermissionsResponse" ) as PermissionsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1400,45 +1215,24 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsersResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsersResponse", - "" + "UsersResponse" ) as UsersResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1471,53 +1265,25 @@ export class RolesApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: RoleUpdateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "RoleUpdateResponse", - "" + "RoleUpdateResponse" ) as RoleUpdateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 422 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("422", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(422, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts index 2e1240750f08..f04c5bc68be5 100644 --- a/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts +++ b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { SecurityFilterCreateRequest } from "../models/SecurityFilterCreateRequest"; @@ -775,45 +774,24 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityFilterResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityFilterResponse", - "" + "SecurityFilterResponse" ) as SecurityFilterResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -846,37 +824,23 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityMonitoringRuleResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityMonitoringRuleResponse", - "" + "SecurityMonitoringRuleResponse" ) as SecurityMonitoringRuleResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -907,32 +871,19 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -965,32 +916,19 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1023,46 +961,25 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityMonitoringSignalTriageUpdateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityMonitoringSignalTriageUpdateResponse", - "" + "SecurityMonitoringSignalTriageUpdateResponse" ) as SecurityMonitoringSignalTriageUpdateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1096,46 +1013,25 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityMonitoringSignalTriageUpdateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityMonitoringSignalTriageUpdateResponse", - "" + "SecurityMonitoringSignalTriageUpdateResponse" ) as SecurityMonitoringSignalTriageUpdateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1169,46 +1065,25 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityMonitoringSignalTriageUpdateResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityMonitoringSignalTriageUpdateResponse", - "" + "SecurityMonitoringSignalTriageUpdateResponse" ) as SecurityMonitoringSignalTriageUpdateResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1242,37 +1117,23 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityFilterResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityFilterResponse", - "" + "SecurityFilterResponse" ) as SecurityFilterResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1305,29 +1166,19 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityMonitoringRuleResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityMonitoringRuleResponse", - "" + "SecurityMonitoringRuleResponse" ) as SecurityMonitoringRuleResponse; return body; } - if (isCodeInRange("404", response.httpStatusCode)) { + if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1360,29 +1211,19 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityFiltersResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityFiltersResponse", - "" + "SecurityFiltersResponse" ) as SecurityFiltersResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1415,30 +1256,20 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityMonitoringListRulesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityMonitoringListRulesResponse", - "" + "SecurityMonitoringListRulesResponse" ) as SecurityMonitoringListRulesResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1472,38 +1303,24 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityMonitoringSignalsListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityMonitoringSignalsListResponse", - "" + "SecurityMonitoringSignalsListResponse" ) as SecurityMonitoringSignalsListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1537,38 +1354,24 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityMonitoringSignalsListResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityMonitoringSignalsListResponse", - "" + "SecurityMonitoringSignalsListResponse" ) as SecurityMonitoringSignalsListResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1602,53 +1405,25 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityFilterResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityFilterResponse", - "" + "SecurityFilterResponse" ) as SecurityFilterResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("409", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(409, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 409 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1681,53 +1456,25 @@ export class SecurityMonitoringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: SecurityMonitoringRuleResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SecurityMonitoringRuleResponse", - "" + "SecurityMonitoringRuleResponse" ) as SecurityMonitoringRuleResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("401", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(401, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/ServiceAccountsApi.ts b/packages/datadog-api-client-v2/apis/ServiceAccountsApi.ts index c1e0cf9ebf57..d3771eab9a1f 100644 --- a/packages/datadog-api-client-v2/apis/ServiceAccountsApi.ts +++ b/packages/datadog-api-client-v2/apis/ServiceAccountsApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { ApplicationKeyCreateRequest } from "../models/ApplicationKeyCreateRequest"; @@ -347,37 +346,23 @@ export class ServiceAccountsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: ApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ApplicationKeyResponse", - "" + "ApplicationKeyResponse" ) as ApplicationKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -410,32 +395,19 @@ export class ServiceAccountsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -468,37 +440,23 @@ export class ServiceAccountsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: PartialApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "PartialApplicationKeyResponse", - "" + "PartialApplicationKeyResponse" ) as PartialApplicationKeyResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -531,45 +489,24 @@ export class ServiceAccountsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: ListApplicationKeysResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "ListApplicationKeysResponse", - "" + "ListApplicationKeysResponse" ) as ListApplicationKeysResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -602,45 +539,24 @@ export class ServiceAccountsApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: PartialApplicationKeyResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "PartialApplicationKeyResponse", - "" + "PartialApplicationKeyResponse" ) as PartialApplicationKeyResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts b/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts index e89458391b9e..2c5d16d5678e 100644 --- a/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts +++ b/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts @@ -16,7 +16,6 @@ import { import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { CostByOrgResponse } from "../models/CostByOrgResponse"; @@ -421,37 +420,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: CostByOrgResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CostByOrgResponse", - "" + "CostByOrgResponse" ) as CostByOrgResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -484,37 +469,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: CostByOrgResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "CostByOrgResponse", - "" + "CostByOrgResponse" ) as CostByOrgResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -547,37 +518,23 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: HourlyUsageResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "HourlyUsageResponse", - "" + "HourlyUsageResponse" ) as HourlyUsageResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -610,38 +567,24 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageApplicationSecurityMonitoringResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageApplicationSecurityMonitoringResponse", - "" + "UsageApplicationSecurityMonitoringResponse" ) as UsageApplicationSecurityMonitoringResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -675,38 +618,24 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageLambdaTracedInvocationsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageLambdaTracedInvocationsResponse", - "" + "UsageLambdaTracedInvocationsResponse" ) as UsageLambdaTracedInvocationsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -740,38 +669,24 @@ export class UsageMeteringApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsageObservabilityPipelinesResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsageObservabilityPipelinesResponse", - "" + "UsageObservabilityPipelinesResponse" ) as UsageObservabilityPipelinesResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/UsersApi.ts b/packages/datadog-api-client-v2/apis/UsersApi.ts index ebb2bf89500e..95f6d99c6c96 100644 --- a/packages/datadog-api-client-v2/apis/UsersApi.ts +++ b/packages/datadog-api-client-v2/apis/UsersApi.ts @@ -15,7 +15,6 @@ import { import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; -import { isCodeInRange } from "../../datadog-api-client-common/util"; import { APIErrorResponse } from "../models/APIErrorResponse"; import { PermissionsResponse } from "../models/PermissionsResponse"; @@ -491,37 +490,23 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: UserResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserResponse", - "" + "UserResponse" ) as UserResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -552,37 +537,23 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: UserResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserResponse", - "" + "UserResponse" ) as UserResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -613,32 +584,19 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("204", response.httpStatusCode)) { + if (response.httpStatusCode == 204) { return; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -671,37 +629,23 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UserInvitationResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserInvitationResponse", - "" + "UserInvitationResponse" ) as UserInvitationResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -732,37 +676,23 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UserResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserResponse", - "" + "UserResponse" ) as UserResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -795,37 +725,23 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UserResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserResponse", - "" + "UserResponse" ) as UserResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -858,37 +774,23 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: PermissionsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "PermissionsResponse", - "" + "PermissionsResponse" ) as PermissionsResponse; return body; } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -919,37 +821,23 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UsersResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UsersResponse", - "" + "UsersResponse" ) as UsersResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -982,37 +870,23 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("201", response.httpStatusCode)) { + if (response.httpStatusCode == 201) { const body: UserInvitationsResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserInvitationsResponse", - "" + "UserInvitationsResponse" ) as UserInvitationsResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1043,53 +917,25 @@ export class UsersApiResponseProcessor { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); - if (isCodeInRange("200", response.httpStatusCode)) { + if (response.httpStatusCode == 200) { const body: UserResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "UserResponse", - "" + "UserResponse" ) as UserResponse; return body; } - if (isCodeInRange("400", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(400, body); - } - if (isCodeInRange("403", response.httpStatusCode)) { + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 422 || + response.httpStatusCode == 429 + ) { const body: APIErrorResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(403, body); - } - if (isCodeInRange("404", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(404, body); - } - if (isCodeInRange("422", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" - ) as APIErrorResponse; - throw new ApiException(422, body); - } - if (isCodeInRange("429", response.httpStatusCode)) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse", - "" + "APIErrorResponse" ) as APIErrorResponse; - throw new ApiException(429, body); + throw new ApiException(response.httpStatusCode, body); } // Work around for missing responses in specification, e.g. for petstore.yaml From 43011bc853d228b31a71724e048bde55ad2fca24 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 11:02:19 -0400 Subject: [PATCH 09/30] Regenerate client from commit 0bdea812 of spec repo (#825) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: Kevin Zou <17015060+nkzou@users.noreply.github.com> --- .apigentools-info | 8 ++++---- .generator/schemas/v1/openapi.yaml | 2 ++ packages/datadog-api-client-v1/models/ObjectSerializer.ts | 1 + .../models/SyntheticsAssertionOperator.ts | 4 +++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index e8428d1394d9..3d0fdee18ac3 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-07 19:30:40.870279", - "spec_repo_commit": "33b7a42c" + "regenerated": "2022-09-09 15:07:40.480200", + "spec_repo_commit": "0bdea812" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-07 19:30:40.887104", - "spec_repo_commit": "33b7a42c" + "regenerated": "2022-09-09 15:07:40.495134", + "spec_repo_commit": "0bdea812" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 45bdd63bf251..c68593f135f1 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -10858,6 +10858,7 @@ components: - validates - isInMoreThan - isInLessThan + - doesNotExist example: contains type: string x-enum-varnames: @@ -10874,6 +10875,7 @@ components: - VALIDATES - IS_IN_MORE_DAYS_THAN - IS_IN_LESS_DAYS_THAN + - DOES_NOT_EXIST SyntheticsAssertionTarget: description: An assertion which uses a simple target. properties: diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index 8b5fe3ff5291..7aefd17e846b 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -916,6 +916,7 @@ const enumsMap: { [key: string]: any[] } = { "validates", "isInMoreThan", "isInLessThan", + "doesNotExist", ], SyntheticsAssertionType: [ "body", diff --git a/packages/datadog-api-client-v1/models/SyntheticsAssertionOperator.ts b/packages/datadog-api-client-v1/models/SyntheticsAssertionOperator.ts index eb881829d99b..1c835985a5f8 100644 --- a/packages/datadog-api-client-v1/models/SyntheticsAssertionOperator.ts +++ b/packages/datadog-api-client-v1/models/SyntheticsAssertionOperator.ts @@ -17,7 +17,8 @@ export type SyntheticsAssertionOperator = | typeof DOES_NOT_MATCH | typeof VALIDATES | typeof IS_IN_MORE_DAYS_THAN - | typeof IS_IN_LESS_DAYS_THAN; + | typeof IS_IN_LESS_DAYS_THAN + | typeof DOES_NOT_EXIST; export const CONTAINS = "contains"; export const DOES_NOT_CONTAIN = "doesNotContain"; export const IS = "is"; @@ -31,3 +32,4 @@ export const DOES_NOT_MATCH = "doesNotMatch"; export const VALIDATES = "validates"; export const IS_IN_MORE_DAYS_THAN = "isInMoreThan"; export const IS_IN_LESS_DAYS_THAN = "isInLessThan"; +export const DOES_NOT_EXIST = "doesNotExist"; From 89bcc1add367b5d589e76a7566c71b83bda59bb2 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 16:09:59 +0000 Subject: [PATCH 10/30] Regenerate client from commit dcd92077 of spec repo (#828) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 86 ++++++++++++++ .../frozen.json | 1 + .../recording.har | 110 ++++++++++++++++++ .../dashboards/CreateDashboard_2652180930.ts | 54 +++++++++ features/v1/dashboards.feature | 12 ++ .../topology_map_widget.json | 34 ++++++ packages/datadog-api-client-v1/index.ts | 6 + .../models/ObjectSerializer.ts | 10 ++ .../models/TopologyMapWidgetDefinition.ts | 87 ++++++++++++++ .../models/TopologyMapWidgetDefinitionType.ts | 8 ++ .../models/TopologyQuery.ts | 58 +++++++++ .../models/TopologyQueryDataSource.ts | 9 ++ .../models/TopologyRequest.ts | 51 ++++++++ .../models/TopologyRequestType.ts | 8 ++ .../models/WidgetDefinition.ts | 2 + 16 files changed, 540 insertions(+), 4 deletions(-) create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-topology_map-widget_2201098304/frozen.json create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-topology_map-widget_2201098304/recording.har create mode 100644 examples/v1/dashboards/CreateDashboard_2652180930.ts create mode 100644 features/v1/dashboards_json_payload/topology_map_widget.json create mode 100644 packages/datadog-api-client-v1/models/TopologyMapWidgetDefinition.ts create mode 100644 packages/datadog-api-client-v1/models/TopologyMapWidgetDefinitionType.ts create mode 100644 packages/datadog-api-client-v1/models/TopologyQuery.ts create mode 100644 packages/datadog-api-client-v1/models/TopologyQueryDataSource.ts create mode 100644 packages/datadog-api-client-v1/models/TopologyRequest.ts create mode 100644 packages/datadog-api-client-v1/models/TopologyRequestType.ts diff --git a/.apigentools-info b/.apigentools-info index 3d0fdee18ac3..a3034515de42 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-09 15:07:40.480200", - "spec_repo_commit": "0bdea812" + "regenerated": "2022-09-12 15:22:05.725204", + "spec_repo_commit": "dcd92077" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-09 15:07:40.495134", - "spec_repo_commit": "0bdea812" + "regenerated": "2022-09-12 15:22:05.740102", + "spec_repo_commit": "dcd92077" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index c68593f135f1..d05b721d6954 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -13380,6 +13380,91 @@ components: style: $ref: '#/components/schemas/WidgetRequestStyle' type: object + TopologyMapWidgetDefinition: + description: This widget displays a topology of nodes and edges for different + data sources. It replaces the service map widget. + properties: + custom_links: + description: List of custom links. + items: + $ref: '#/components/schemas/WidgetCustomLink' + type: array + requests: + description: One or more Topology requests. + items: + $ref: '#/components/schemas/TopologyRequest' + minItems: 1 + type: array + title: + description: Title of your widget. + type: string + title_align: + $ref: '#/components/schemas/WidgetTextAlign' + title_size: + description: Size of the title. + type: string + type: + $ref: '#/components/schemas/TopologyMapWidgetDefinitionType' + required: + - type + - requests + type: object + TopologyMapWidgetDefinitionType: + default: topology_map + description: Type of the topology map widget. + enum: + - topology_map + example: topology_map + type: string + x-enum-varnames: + - TOPOLOGY_MAP + TopologyQuery: + description: Query to service-based topology data sources like the service map + or data streams. + properties: + data_source: + $ref: '#/components/schemas/TopologyQueryDataSource' + filters: + description: Your environment and primary tag (or * if enabled for your + account). + example: + - env:prod + - az:us-east + items: + description: Environment or primary tag, generally in a key:value format + type: string + minItems: 1 + type: array + service: + description: Name of the service + example: myService + type: string + type: object + TopologyQueryDataSource: + description: Name of the data source + enum: + - data_streams + - service_map + type: string + x-enum-varnames: + - DATA_STREAMS + - SERVICE_MAP + TopologyRequest: + description: Request that will return nodes and edges to be used by topology + map. + properties: + query: + $ref: '#/components/schemas/TopologyQuery' + request_type: + $ref: '#/components/schemas/TopologyRequestType' + type: object + TopologyRequestType: + description: Widget request type. + enum: + - topology + type: string + x-enum-varnames: + - TOPOLOGY TreeMapColorBy: default: user deprecated: true @@ -16916,6 +17001,7 @@ components: - $ref: '#/components/schemas/TreeMapWidgetDefinition' - $ref: '#/components/schemas/ListStreamWidgetDefinition' - $ref: '#/components/schemas/FunnelWidgetDefinition' + - $ref: '#/components/schemas/TopologyMapWidgetDefinition' type: object WidgetDisplayType: description: Type of display to use for the request. diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-topology_map-widget_2201098304/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-topology_map-widget_2201098304/frozen.json new file mode 100644 index 000000000000..ea7c57c813f7 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-topology_map-widget_2201098304/frozen.json @@ -0,0 +1 @@ +"2022-09-12T15:16:05.847Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-topology_map-widget_2201098304/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-topology_map-widget_2201098304/recording.har new file mode 100644 index 000000000000..443baa1575e3 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-topology_map-widget_2201098304/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with topology_map widget", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "db23cdbbbb3e26b97a5bc8091d9aef10", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 453, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":\"\",\"is_read_only\":false,\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_topology_map_widget-1662995765\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"data_source\":\"service_map\",\"filters\":[\"env:none\",\"environment:*\"],\"service\":\"\"},\"request_type\":\"topology\"}],\"title\":\"\",\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"topology_map\"},\"layout\":{\"height\":15,\"width\":47,\"x\":0,\"y\":0}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 758, + "content": { + "mimeType": "application/json", + "size": 758, + "text": "{\"notify_list\":[],\"description\":\"\",\"restricted_roles\":[],\"author_name\":null,\"template_variables\":[],\"is_read_only\":false,\"id\":\"8mx-5gx-wjm\",\"title\":\"Test-Create_a_new_dashboard_with_topology_map_widget-1662995765\",\"url\":\"/dashboard/8mx-5gx-wjm/test-createanewdashboardwithtopologymapwidget-1662995765\",\"created_at\":\"2022-09-12T15:16:06.040625+00:00\",\"modified_at\":\"2022-09-12T15:16:06.040625+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"type\":\"topology_map\",\"requests\":[{\"query\":{\"data_source\":\"service_map\",\"service\":\"\",\"filters\":[\"env:none\",\"environment:*\"]},\"request_type\":\"topology\"}],\"title_align\":\"left\",\"title_size\":\"16\",\"title\":\"\"},\"layout\":{\"y\":0,\"width\":47,\"x\":0,\"height\":15},\"id\":1383483616434400}],\"layout_type\":\"free\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 593, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-12T15:16:05.864Z", + "time": 224 + }, + { + "_id": "d969104a3036229802322499a974f7ab", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 520, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard/8mx-5gx-wjm" + }, + "response": { + "bodySize": 39, + "content": { + "mimeType": "application/json", + "size": 39, + "text": "{\"deleted_dashboard_id\":\"8mx-5gx-wjm\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 592, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-12T15:16:06.101Z", + "time": 152 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v1/dashboards/CreateDashboard_2652180930.ts b/examples/v1/dashboards/CreateDashboard_2652180930.ts new file mode 100644 index 000000000000..f6a5c6651ac5 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2652180930.ts @@ -0,0 +1,54 @@ +/** + * Create a new dashboard with topology_map widget + */ + +import { client, v1 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v1.DashboardsApi(configuration); + +const params: v1.DashboardsApiCreateDashboardRequest = { + body: { + title: "Example-Create_a_new_dashboard_with_topology_map_widget", + description: "", + widgets: [ + { + layout: { + x: 0, + y: 0, + width: 47, + height: 15, + }, + definition: { + title: "", + titleSize: "16", + titleAlign: "left", + type: "topology_map", + requests: [ + { + requestType: "topology", + query: { + dataSource: "service_map", + service: "", + filters: ["env:none", "environment:*"], + }, + }, + ], + }, + }, + ], + templateVariables: [], + layoutType: "free", + isReadOnly: false, + notifyList: [], + }, +}; + +apiInstance + .createDashboard(params) + .then((data: v1.Dashboard) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index f9a90ee42c2b..ef0406843d30 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -432,6 +432,18 @@ Feature: Dashboards Then the response status is 200 OK And the response "widgets[0].definition.type" is equal to "toplist" + @team:DataDog/dashboards + Scenario: Create a new dashboard with topology_map widget + Given new "CreateDashboard" request + And body from file "dashboards_json_payload/topology_map_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "topology_map" + And the response "widgets[0].definition.requests[0].request_type" is equal to "topology" + And the response "widgets[0].definition.requests[0].query.data_source" is equal to "service_map" + And the response "widgets[0].definition.requests[0].query.service" is equal to "" + And the response "widgets[0].definition.requests[0].query.filters" is equal to ["env:none","environment:*"] + @team:DataDog/dashboards Scenario: Create a new dashboard with trace_service widget Given new "CreateDashboard" request diff --git a/features/v1/dashboards_json_payload/topology_map_widget.json b/features/v1/dashboards_json_payload/topology_map_widget.json new file mode 100644 index 000000000000..e3cf88351828 --- /dev/null +++ b/features/v1/dashboards_json_payload/topology_map_widget.json @@ -0,0 +1,34 @@ +{ + "title": "{{ unique }}", + "description": "", + "widgets": [ + { + "layout": { + "x": 0, + "y": 0, + "width": 47, + "height": 15 + }, + "definition": { + "title": "", + "title_size": "16", + "title_align": "left", + "type": "topology_map", + "requests": [ + { + "request_type": "topology", + "query": { + "data_source": "service_map", + "service": "", + "filters": ["env:none", "environment:*"] + } + } + ] + } + } + ], + "template_variables": [], + "layout_type": "free", + "is_read_only": false, + "notify_list": [] +} diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index 1cb4220a092b..67bbaf85dfc1 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -885,6 +885,12 @@ export { TimeseriesWidgetRequest } from "./models/TimeseriesWidgetRequest"; export { ToplistWidgetDefinition } from "./models/ToplistWidgetDefinition"; export { ToplistWidgetDefinitionType } from "./models/ToplistWidgetDefinitionType"; export { ToplistWidgetRequest } from "./models/ToplistWidgetRequest"; +export { TopologyMapWidgetDefinition } from "./models/TopologyMapWidgetDefinition"; +export { TopologyMapWidgetDefinitionType } from "./models/TopologyMapWidgetDefinitionType"; +export { TopologyQuery } from "./models/TopologyQuery"; +export { TopologyQueryDataSource } from "./models/TopologyQueryDataSource"; +export { TopologyRequest } from "./models/TopologyRequest"; +export { TopologyRequestType } from "./models/TopologyRequestType"; export { TreeMapColorBy } from "./models/TreeMapColorBy"; export { TreeMapGroupBy } from "./models/TreeMapGroupBy"; export { TreeMapSizeBy } from "./models/TreeMapSizeBy"; diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index 7aefd17e846b..af0784843a27 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -416,6 +416,9 @@ import { TimeseriesWidgetExpressionAlias } from "./TimeseriesWidgetExpressionAli import { TimeseriesWidgetRequest } from "./TimeseriesWidgetRequest"; import { ToplistWidgetDefinition } from "./ToplistWidgetDefinition"; import { ToplistWidgetRequest } from "./ToplistWidgetRequest"; +import { TopologyMapWidgetDefinition } from "./TopologyMapWidgetDefinition"; +import { TopologyQuery } from "./TopologyQuery"; +import { TopologyRequest } from "./TopologyRequest"; import { TreeMapWidgetDefinition } from "./TreeMapWidgetDefinition"; import { TreeMapWidgetRequest } from "./TreeMapWidgetRequest"; import { UsageAnalyzedLogsHour } from "./UsageAnalyzedLogsHour"; @@ -1082,6 +1085,9 @@ const enumsMap: { [key: string]: any[] } = { TimeseriesWidgetLegendColumn: ["value", "avg", "sum", "min", "max"], TimeseriesWidgetLegendLayout: ["auto", "horizontal", "vertical"], ToplistWidgetDefinitionType: ["toplist"], + TopologyMapWidgetDefinitionType: ["topology_map"], + TopologyQueryDataSource: ["data_streams", "service_map"], + TopologyRequestType: ["topology"], TreeMapColorBy: ["user"], TreeMapGroupBy: ["user", "family", "process"], TreeMapSizeBy: ["pct_cpu", "pct_mem"], @@ -1722,6 +1728,9 @@ const typeMap: { [index: string]: any } = { TimeseriesWidgetRequest: TimeseriesWidgetRequest, ToplistWidgetDefinition: ToplistWidgetDefinition, ToplistWidgetRequest: ToplistWidgetRequest, + TopologyMapWidgetDefinition: TopologyMapWidgetDefinition, + TopologyQuery: TopologyQuery, + TopologyRequest: TopologyRequest, TreeMapWidgetDefinition: TreeMapWidgetDefinition, TreeMapWidgetRequest: TreeMapWidgetRequest, UsageAnalyzedLogsHour: UsageAnalyzedLogsHour, @@ -1943,6 +1952,7 @@ const oneOfMap: { [index: string]: string[] } = { "TreeMapWidgetDefinition", "ListStreamWidgetDefinition", "FunnelWidgetDefinition", + "TopologyMapWidgetDefinition", ], }; diff --git a/packages/datadog-api-client-v1/models/TopologyMapWidgetDefinition.ts b/packages/datadog-api-client-v1/models/TopologyMapWidgetDefinition.ts new file mode 100644 index 000000000000..26bb224d780b --- /dev/null +++ b/packages/datadog-api-client-v1/models/TopologyMapWidgetDefinition.ts @@ -0,0 +1,87 @@ +/** + * 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. + */ +import { TopologyMapWidgetDefinitionType } from "./TopologyMapWidgetDefinitionType"; +import { TopologyRequest } from "./TopologyRequest"; +import { WidgetCustomLink } from "./WidgetCustomLink"; +import { WidgetTextAlign } from "./WidgetTextAlign"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * This widget displays a topology of nodes and edges for different data sources. It replaces the service map widget. + */ +export class TopologyMapWidgetDefinition { + /** + * List of custom links. + */ + "customLinks"?: Array; + /** + * One or more Topology requests. + */ + "requests": Array; + /** + * Title of your widget. + */ + "title"?: string; + /** + * How to align the text on the widget. + */ + "titleAlign"?: WidgetTextAlign; + /** + * Size of the title. + */ + "titleSize"?: string; + /** + * Type of the topology map widget. + */ + "type": TopologyMapWidgetDefinitionType; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + customLinks: { + baseName: "custom_links", + type: "Array", + }, + requests: { + baseName: "requests", + type: "Array", + required: true, + }, + title: { + baseName: "title", + type: "string", + }, + titleAlign: { + baseName: "title_align", + type: "WidgetTextAlign", + }, + titleSize: { + baseName: "title_size", + type: "string", + }, + type: { + baseName: "type", + type: "TopologyMapWidgetDefinitionType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TopologyMapWidgetDefinition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/TopologyMapWidgetDefinitionType.ts b/packages/datadog-api-client-v1/models/TopologyMapWidgetDefinitionType.ts new file mode 100644 index 000000000000..673910145d57 --- /dev/null +++ b/packages/datadog-api-client-v1/models/TopologyMapWidgetDefinitionType.ts @@ -0,0 +1,8 @@ +/** + * 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. + */ + +export type TopologyMapWidgetDefinitionType = typeof TOPOLOGY_MAP; +export const TOPOLOGY_MAP = "topology_map"; diff --git a/packages/datadog-api-client-v1/models/TopologyQuery.ts b/packages/datadog-api-client-v1/models/TopologyQuery.ts new file mode 100644 index 000000000000..293f6a6c7a7f --- /dev/null +++ b/packages/datadog-api-client-v1/models/TopologyQuery.ts @@ -0,0 +1,58 @@ +/** + * 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. + */ +import { TopologyQueryDataSource } from "./TopologyQueryDataSource"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Query to service-based topology data sources like the service map or data streams. + */ +export class TopologyQuery { + /** + * Name of the data source + */ + "dataSource"?: TopologyQueryDataSource; + /** + * Your environment and primary tag (or * if enabled for your account). + */ + "filters"?: Array; + /** + * Name of the service + */ + "service"?: string; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + dataSource: { + baseName: "data_source", + type: "TopologyQueryDataSource", + }, + filters: { + baseName: "filters", + type: "Array", + }, + service: { + baseName: "service", + type: "string", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TopologyQuery.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/TopologyQueryDataSource.ts b/packages/datadog-api-client-v1/models/TopologyQueryDataSource.ts new file mode 100644 index 000000000000..ffddfd645b5a --- /dev/null +++ b/packages/datadog-api-client-v1/models/TopologyQueryDataSource.ts @@ -0,0 +1,9 @@ +/** + * 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. + */ + +export type TopologyQueryDataSource = typeof DATA_STREAMS | typeof SERVICE_MAP; +export const DATA_STREAMS = "data_streams"; +export const SERVICE_MAP = "service_map"; diff --git a/packages/datadog-api-client-v1/models/TopologyRequest.ts b/packages/datadog-api-client-v1/models/TopologyRequest.ts new file mode 100644 index 000000000000..be56a34e3e5b --- /dev/null +++ b/packages/datadog-api-client-v1/models/TopologyRequest.ts @@ -0,0 +1,51 @@ +/** + * 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. + */ +import { TopologyQuery } from "./TopologyQuery"; +import { TopologyRequestType } from "./TopologyRequestType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request that will return nodes and edges to be used by topology map. + */ +export class TopologyRequest { + /** + * Query to service-based topology data sources like the service map or data streams. + */ + "query"?: TopologyQuery; + /** + * Widget request type. + */ + "requestType"?: TopologyRequestType; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + query: { + baseName: "query", + type: "TopologyQuery", + }, + requestType: { + baseName: "request_type", + type: "TopologyRequestType", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TopologyRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/TopologyRequestType.ts b/packages/datadog-api-client-v1/models/TopologyRequestType.ts new file mode 100644 index 000000000000..1d0034c25678 --- /dev/null +++ b/packages/datadog-api-client-v1/models/TopologyRequestType.ts @@ -0,0 +1,8 @@ +/** + * 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. + */ + +export type TopologyRequestType = typeof TOPOLOGY; +export const TOPOLOGY = "topology"; diff --git a/packages/datadog-api-client-v1/models/WidgetDefinition.ts b/packages/datadog-api-client-v1/models/WidgetDefinition.ts index 944c0ec99f48..121603061ed9 100644 --- a/packages/datadog-api-client-v1/models/WidgetDefinition.ts +++ b/packages/datadog-api-client-v1/models/WidgetDefinition.ts @@ -31,6 +31,7 @@ import { SunburstWidgetDefinition } from "./SunburstWidgetDefinition"; import { TableWidgetDefinition } from "./TableWidgetDefinition"; import { TimeseriesWidgetDefinition } from "./TimeseriesWidgetDefinition"; import { ToplistWidgetDefinition } from "./ToplistWidgetDefinition"; +import { TopologyMapWidgetDefinition } from "./TopologyMapWidgetDefinition"; import { TreeMapWidgetDefinition } from "./TreeMapWidgetDefinition"; import { UnparsedObject } from "../../datadog-api-client-common/util"; @@ -69,4 +70,5 @@ export type WidgetDefinition = | TreeMapWidgetDefinition | ListStreamWidgetDefinition | FunnelWidgetDefinition + | TopologyMapWidgetDefinition | UnparsedObject; From 97ebd2cc99641a9f494bed27d0050a680c33bb58 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, 13 Sep 2022 13:27:57 +0000 Subject: [PATCH 11/30] Regenerate client from commit 82fabb35 of spec repo (#830) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 289 +++++++++++++++++- packages/datadog-api-client-common/servers.ts | 1 + .../apis/ServiceLevelObjectivesApi.ts | 15 + packages/datadog-api-client-v1/index.ts | 7 + .../models/ObjectSerializer.ts | 13 + .../models/SLOCreator.ts | 57 ++++ .../models/SLOOverallStatuses.ts | 96 ++++++ .../models/SLORawErrorBudgetRemaining.ts | 50 +++ .../models/SearchSLOQuery.ts | 60 ++++ .../models/SearchSLOResponseDataAttributes.ts | 6 +- .../models/SearchSLOThreshold.ts | 87 ++++++ .../models/SearchSLOTimeframe.ts | 13 + .../models/SearchServiceLevelObjective.ts | 165 ++++++++++ 14 files changed, 855 insertions(+), 12 deletions(-) create mode 100644 packages/datadog-api-client-v1/models/SLOCreator.ts create mode 100644 packages/datadog-api-client-v1/models/SLOOverallStatuses.ts create mode 100644 packages/datadog-api-client-v1/models/SLORawErrorBudgetRemaining.ts create mode 100644 packages/datadog-api-client-v1/models/SearchSLOQuery.ts create mode 100644 packages/datadog-api-client-v1/models/SearchSLOThreshold.ts create mode 100644 packages/datadog-api-client-v1/models/SearchSLOTimeframe.ts create mode 100644 packages/datadog-api-client-v1/models/SearchServiceLevelObjective.ts diff --git a/.apigentools-info b/.apigentools-info index a3034515de42..74cd8e48592d 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-12 15:22:05.725204", - "spec_repo_commit": "dcd92077" + "regenerated": "2022-09-13 07:28:13.750530", + "spec_repo_commit": "82fabb35" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-12 15:22:05.740102", - "spec_repo_commit": "dcd92077" + "regenerated": "2022-09-13 07:28:13.767666", + "spec_repo_commit": "82fabb35" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index d05b721d6954..3b423d98db4b 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -8696,6 +8696,20 @@ components: example: UTC type: string type: object + SLOCreator: + description: The creator of the SLO + nullable: true + properties: + email: + description: Email of the creator. + type: string + id: + description: User ID of the creator. + type: string + name: + description: Name of the creator. + type: string + type: object SLODeleteResponse: description: A response list of all service level objective deleted. properties: @@ -9206,6 +9220,55 @@ components: format: int64 type: integer type: object + SLOOverallStatuses: + description: Overall status of the SLO by timeframes. + properties: + error: + description: Error message if SLO status or error budget could not be calculated. + nullable: true + type: string + indexed_at: + description: 'timestamp (UNIX time in seconds) of when the SLO status and + error budget + + were calculated.' + example: 1662496260 + format: int64 + type: integer + raw_error_budget_remaining: + $ref: '#/components/schemas/SLORawErrorBudgetRemaining' + span_precision: + description: The amount of decimal places the SLI value is accurate to. + example: 2 + format: int64 + type: integer + status: + description: The status of the SLO. + example: 100 + format: double + nullable: true + type: number + target: + description: The target of the SLO. + example: 99 + format: double + type: number + timeframe: + $ref: '#/components/schemas/SLOTimeframe' + type: object + SLORawErrorBudgetRemaining: + description: Error budget remaining for an SLO. + properties: + unit: + description: Error budget remaining unit. + example: requests + type: string + value: + description: Error budget remaining value. + example: 60 + format: double + type: number + type: object SLOResponse: description: A service level objective response containing a single service level objective. @@ -9643,6 +9706,38 @@ components: - formula - dimension type: object + SearchSLOQuery: + description: 'A metric-based SLO. **Required if type is `metric`**. Note that + Datadog only allows the sum by aggregator + + to be used because this will sum up all request counts instead of averaging + them, or taking the max or + + min of all of those requests.' + nullable: true + properties: + denominator: + description: A Datadog metric query for total (valid) events. + example: sum:my.custom.metric{*}.as_count() + type: string + metrics: + description: 'Metric names used in the query''s numerator and denominator. + + This field will return null and will be implemented in the next version + of this endpoint.' + example: + - my.custom.metric + - my.other.custom.metric + items: + description: Metric name. + type: string + nullable: true + type: array + numerator: + description: A Datadog metric query for good events. + example: sum:my.custom.metric{type:good}.as_count() + type: string + type: object SearchSLOResponse: description: A search SLO response containing results from the search query. properties: @@ -9671,7 +9766,7 @@ components: slo: description: SLOs items: - $ref: '#/components/schemas/ServiceLevelObjective' + $ref: '#/components/schemas/SearchServiceLevelObjective' type: array type: object SearchSLOResponseDataAttributesFacets: @@ -9801,6 +9896,181 @@ components: description: Type of pagination. type: string type: object + SearchSLOThreshold: + description: SLO thresholds (target and optionally warning) for a single time + window. + properties: + target: + description: 'The target value for the service level indicator within the + corresponding + + timeframe.' + example: 99.9 + format: double + type: number + target_display: + description: 'A string representation of the target that indicates its precision. + + It uses trailing zeros to show significant decimal places (for example + `98.00`). + + + Always included in service level objective responses. Ignored in + + create/update requests.' + example: '99.9' + type: string + timeframe: + $ref: '#/components/schemas/SearchSLOTimeframe' + warning: + description: The warning value for the service level objective. + example: 90.0 + format: double + nullable: true + type: number + warning_display: + description: 'A string representation of the warning target (see the description + of + + the `target_display` field for details). + + + Included in service level objective responses if a warning target exists. + + Ignored in create/update requests.' + example: '90.0' + nullable: true + type: string + required: + - timeframe + - target + type: object + SearchSLOTimeframe: + description: The SLO time window options. + enum: + - 7d + - 30d + - 90d + example: 30d + type: string + x-enum-varnames: + - SEVEN_DAYS + - THIRTY_DAYS + - NINETY_DAYS + SearchServiceLevelObjective: + description: 'A service level objective object includes a service level indicator, + thresholds + + for one or more timeframes, and metadata (`name`, `description`, `tags`, etc.).' + properties: + all_tags: + description: 'A list of tags associated with this service level objective. + + Always included in service level objective responses (but may be empty). + + Optional in create/update requests.' + example: + - env:prod + - app:core + items: + description: A tag to apply to your SLO. + type: string + type: array + created_at: + description: 'Creation timestamp (UNIX time in seconds) + + + Always included in service level objective responses.' + format: int64 + readOnly: true + type: integer + creator: + $ref: '#/components/schemas/SLOCreator' + description: + description: 'A user-defined description of the service level objective. + + + Always included in service level objective responses (but may be `null`). + + Optional in create/update requests.' + nullable: true + type: string + groups: + description: 'A list of (up to 100) monitor groups that narrow the scope + of a monitor service level objective. + + + Included in service level objective responses if it is not empty. Optional + in + + create/update requests for monitor service level objectives, but may only + be + + used when then length of the `monitor_ids` field is one.' + example: + - env:prod + - role:mysql + items: + description: A group name, for instance `env:prod`. + type: string + nullable: true + type: array + id: + description: 'A unique identifier for the service level objective object. + + + Always included in service level objective responses.' + readOnly: true + type: string + modified_at: + description: 'Modification timestamp (UNIX time in seconds) + + + Always included in service level objective responses.' + format: int64 + readOnly: true + type: integer + monitor_ids: + description: 'A list of monitor ids that defines the scope of a monitor + service level + + objective. **Required if type is `monitor`**.' + items: + description: A monitor ID. + format: int64 + type: integer + nullable: true + type: array + name: + description: The name of the service level objective object. + example: Custom Metric SLO + type: string + overall_status: + description: calculated status and error budget remaining. + items: + $ref: '#/components/schemas/SLOOverallStatuses' + type: array + query: + $ref: '#/components/schemas/SearchSLOQuery' + thresholds: + description: 'The thresholds (timeframes and associated targets) for this + service level + + objective object.' + example: + - target: 95 + target_display: '95' + timeframe: 7d + - target: 95 + target_display: '95' + timeframe: 30d + warning: 97 + warning_display: '97' + items: + $ref: '#/components/schemas/SearchSLOThreshold' + type: array + type: + $ref: '#/components/schemas/SLOType' Series: description: 'A metric to submit to Datadog. @@ -24378,7 +24648,11 @@ paths: description: Get a list of service level objective objects for your organization. operationId: SearchSLO parameters: - - description: The query string to filter results based on SLO names. + - description: 'The query string to filter results based on SLO names. + + Some examples of queries include `service:` + + and ``.' in: query name: query required: false @@ -24399,6 +24673,12 @@ paths: schema: format: int64 type: integer + - description: Whether or not to return facet information in the response `[default=false]`. + in: query + name: include_facets + required: false + schema: + type: boolean responses: '200': content: @@ -24428,6 +24708,7 @@ paths: description: The regional site for Datadog customers. enum: - datadoghq.com + - datadoghq.eu - us3.datadoghq.com - us5.datadoghq.com - ddog-gov.com @@ -24453,9 +24734,7 @@ paths: summary: Search for SLOs tags: - Service Level Objectives - x-unstable: '**Note**: Note: This endpoint is in public beta for US regions. - - It is not currently supported in the EU region. + x-unstable: '**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v1/slo/{slo_id}: diff --git a/packages/datadog-api-client-common/servers.ts b/packages/datadog-api-client-common/servers.ts index ad2337114232..5c14a565e904 100644 --- a/packages/datadog-api-client-common/servers.ts +++ b/packages/datadog-api-client-common/servers.ts @@ -148,6 +148,7 @@ export const operationServers: { new ServerConfiguration<{ site: | "datadoghq.com" + | "datadoghq.eu" | "us3.datadoghq.com" | "us5.datadoghq.com" | "ddog-gov.com"; diff --git a/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts b/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts index 5689ee8cbd76..38c13c3c71fd 100644 --- a/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts +++ b/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts @@ -448,6 +448,7 @@ export class ServiceLevelObjectivesApiRequestFactory extends BaseAPIRequestFacto query?: string, pageSize?: number, pageNumber?: number, + includeFacets?: boolean, _options?: Configuration ): Promise { const _config = _options || this.configuration; @@ -487,6 +488,12 @@ export class ServiceLevelObjectivesApiRequestFactory extends BaseAPIRequestFacto ObjectSerializer.serialize(pageNumber, "number", "int64") ); } + if (includeFacets !== undefined) { + requestContext.setQueryParam( + "include_facets", + ObjectSerializer.serialize(includeFacets, "boolean", "") + ); + } // Apply auth methods applySecurityAuthentication(_config, requestContext, [ @@ -1164,6 +1171,8 @@ export interface ServiceLevelObjectivesApiListSLOsRequest { export interface ServiceLevelObjectivesApiSearchSLORequest { /** * The query string to filter results based on SLO names. + * Some examples of queries include `service:` + * and ``. * @type string */ query?: string; @@ -1177,6 +1186,11 @@ export interface ServiceLevelObjectivesApiSearchSLORequest { * @type number */ pageNumber?: number; + /** + * Whether or not to return facet information in the response `[default=false]`. + * @type boolean + */ + includeFacets?: boolean; } export interface ServiceLevelObjectivesApiUpdateSLORequest { @@ -1418,6 +1432,7 @@ export class ServiceLevelObjectivesApi { param.query, param.pageSize, param.pageNumber, + param.includeFacets, options ); return requestContextPromise.then((requestContext) => { diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index 67bbaf85dfc1..878304be8750 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -678,6 +678,8 @@ export { ScatterPlotWidgetDefinition } from "./models/ScatterPlotWidgetDefinitio export { ScatterPlotWidgetDefinitionRequests } from "./models/ScatterPlotWidgetDefinitionRequests"; export { ScatterPlotWidgetDefinitionType } from "./models/ScatterPlotWidgetDefinitionType"; export { ScatterplotWidgetFormula } from "./models/ScatterplotWidgetFormula"; +export { SearchServiceLevelObjective } from "./models/SearchServiceLevelObjective"; +export { SearchSLOQuery } from "./models/SearchSLOQuery"; export { SearchSLOResponse } from "./models/SearchSLOResponse"; export { SearchSLOResponseData } from "./models/SearchSLOResponseData"; export { SearchSLOResponseDataAttributes } from "./models/SearchSLOResponseDataAttributes"; @@ -687,6 +689,8 @@ export { SearchSLOResponseDataAttributesFacetsObjectString } from "./models/Sear export { SearchSLOResponseLinks } from "./models/SearchSLOResponseLinks"; export { SearchSLOResponseMeta } from "./models/SearchSLOResponseMeta"; export { SearchSLOResponseMetaPage } from "./models/SearchSLOResponseMetaPage"; +export { SearchSLOThreshold } from "./models/SearchSLOThreshold"; +export { SearchSLOTimeframe } from "./models/SearchSLOTimeframe"; export { Series } from "./models/Series"; export { ServiceCheck } from "./models/ServiceCheck"; export { ServiceCheckStatus } from "./models/ServiceCheckStatus"; @@ -719,6 +723,7 @@ export { SLOCorrectionType } from "./models/SLOCorrectionType"; export { SLOCorrectionUpdateData } from "./models/SLOCorrectionUpdateData"; export { SLOCorrectionUpdateRequest } from "./models/SLOCorrectionUpdateRequest"; export { SLOCorrectionUpdateRequestAttributes } from "./models/SLOCorrectionUpdateRequestAttributes"; +export { SLOCreator } from "./models/SLOCreator"; export { SLODeleteResponse } from "./models/SLODeleteResponse"; export { SLOErrorTimeframe } from "./models/SLOErrorTimeframe"; export { SLOHistoryMetrics } from "./models/SLOHistoryMetrics"; @@ -734,6 +739,8 @@ export { SLOHistorySLIData } from "./models/SLOHistorySLIData"; export { SLOListResponse } from "./models/SLOListResponse"; export { SLOListResponseMetadata } from "./models/SLOListResponseMetadata"; export { SLOListResponseMetadataPage } from "./models/SLOListResponseMetadataPage"; +export { SLOOverallStatuses } from "./models/SLOOverallStatuses"; +export { SLORawErrorBudgetRemaining } from "./models/SLORawErrorBudgetRemaining"; export { SLOResponse } from "./models/SLOResponse"; export { SLOResponseData } from "./models/SLOResponseData"; export { SLOThreshold } from "./models/SLOThreshold"; diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index af0784843a27..a317ceac8770 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -274,6 +274,7 @@ import { SLOCorrectionResponseAttributesModifier } from "./SLOCorrectionResponse import { SLOCorrectionUpdateData } from "./SLOCorrectionUpdateData"; import { SLOCorrectionUpdateRequest } from "./SLOCorrectionUpdateRequest"; import { SLOCorrectionUpdateRequestAttributes } from "./SLOCorrectionUpdateRequestAttributes"; +import { SLOCreator } from "./SLOCreator"; import { SLODeleteResponse } from "./SLODeleteResponse"; import { SLOHistoryMetrics } from "./SLOHistoryMetrics"; import { SLOHistoryMetricsSeries } from "./SLOHistoryMetricsSeries"; @@ -288,6 +289,8 @@ import { SLOHistorySLIData } from "./SLOHistorySLIData"; import { SLOListResponse } from "./SLOListResponse"; import { SLOListResponseMetadata } from "./SLOListResponseMetadata"; import { SLOListResponseMetadataPage } from "./SLOListResponseMetadataPage"; +import { SLOOverallStatuses } from "./SLOOverallStatuses"; +import { SLORawErrorBudgetRemaining } from "./SLORawErrorBudgetRemaining"; import { SLOResponse } from "./SLOResponse"; import { SLOResponseData } from "./SLOResponseData"; import { SLOThreshold } from "./SLOThreshold"; @@ -297,6 +300,7 @@ import { ScatterPlotWidgetDefinition } from "./ScatterPlotWidgetDefinition"; import { ScatterPlotWidgetDefinitionRequests } from "./ScatterPlotWidgetDefinitionRequests"; import { ScatterplotTableRequest } from "./ScatterplotTableRequest"; import { ScatterplotWidgetFormula } from "./ScatterplotWidgetFormula"; +import { SearchSLOQuery } from "./SearchSLOQuery"; import { SearchSLOResponse } from "./SearchSLOResponse"; import { SearchSLOResponseData } from "./SearchSLOResponseData"; import { SearchSLOResponseDataAttributes } from "./SearchSLOResponseDataAttributes"; @@ -306,6 +310,8 @@ import { SearchSLOResponseDataAttributesFacetsObjectString } from "./SearchSLORe import { SearchSLOResponseLinks } from "./SearchSLOResponseLinks"; import { SearchSLOResponseMeta } from "./SearchSLOResponseMeta"; import { SearchSLOResponseMetaPage } from "./SearchSLOResponseMetaPage"; +import { SearchSLOThreshold } from "./SearchSLOThreshold"; +import { SearchServiceLevelObjective } from "./SearchServiceLevelObjective"; import { Series } from "./Series"; import { ServiceCheck } from "./ServiceCheck"; import { ServiceLevelObjective } from "./ServiceLevelObjective"; @@ -861,6 +867,7 @@ const enumsMap: { [key: string]: any[] } = { ScatterPlotWidgetDefinitionType: ["scatterplot"], ScatterplotDimension: ["x", "y", "radius", "color"], ScatterplotWidgetAggregator: ["avg", "last", "max", "min", "sum"], + SearchSLOTimeframe: ["7d", "30d", "90d"], ServiceCheckStatus: [0, 1, 2, 3], ServiceMapWidgetDefinitionType: ["servicemap"], ServiceSummaryWidgetDefinitionType: ["trace_service"], @@ -1574,6 +1581,7 @@ const typeMap: { [index: string]: any } = { SLOCorrectionUpdateData: SLOCorrectionUpdateData, SLOCorrectionUpdateRequest: SLOCorrectionUpdateRequest, SLOCorrectionUpdateRequestAttributes: SLOCorrectionUpdateRequestAttributes, + SLOCreator: SLOCreator, SLODeleteResponse: SLODeleteResponse, SLOHistoryMetrics: SLOHistoryMetrics, SLOHistoryMetricsSeries: SLOHistoryMetricsSeries, @@ -1588,6 +1596,8 @@ const typeMap: { [index: string]: any } = { SLOListResponse: SLOListResponse, SLOListResponseMetadata: SLOListResponseMetadata, SLOListResponseMetadataPage: SLOListResponseMetadataPage, + SLOOverallStatuses: SLOOverallStatuses, + SLORawErrorBudgetRemaining: SLORawErrorBudgetRemaining, SLOResponse: SLOResponse, SLOResponseData: SLOResponseData, SLOThreshold: SLOThreshold, @@ -1597,6 +1607,7 @@ const typeMap: { [index: string]: any } = { ScatterPlotWidgetDefinitionRequests: ScatterPlotWidgetDefinitionRequests, ScatterplotTableRequest: ScatterplotTableRequest, ScatterplotWidgetFormula: ScatterplotWidgetFormula, + SearchSLOQuery: SearchSLOQuery, SearchSLOResponse: SearchSLOResponse, SearchSLOResponseData: SearchSLOResponseData, SearchSLOResponseDataAttributes: SearchSLOResponseDataAttributes, @@ -1608,6 +1619,8 @@ const typeMap: { [index: string]: any } = { SearchSLOResponseLinks: SearchSLOResponseLinks, SearchSLOResponseMeta: SearchSLOResponseMeta, SearchSLOResponseMetaPage: SearchSLOResponseMetaPage, + SearchSLOThreshold: SearchSLOThreshold, + SearchServiceLevelObjective: SearchServiceLevelObjective, Series: Series, ServiceCheck: ServiceCheck, ServiceLevelObjective: ServiceLevelObjective, diff --git a/packages/datadog-api-client-v1/models/SLOCreator.ts b/packages/datadog-api-client-v1/models/SLOCreator.ts new file mode 100644 index 000000000000..c2ec0041d4e5 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SLOCreator.ts @@ -0,0 +1,57 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The creator of the SLO + */ +export class SLOCreator { + /** + * Email of the creator. + */ + "email"?: string; + /** + * User ID of the creator. + */ + "id"?: string; + /** + * Name of the creator. + */ + "name"?: string; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + email: { + baseName: "email", + type: "string", + }, + id: { + baseName: "id", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SLOCreator.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/SLOOverallStatuses.ts b/packages/datadog-api-client-v1/models/SLOOverallStatuses.ts new file mode 100644 index 000000000000..d6fa807c61fe --- /dev/null +++ b/packages/datadog-api-client-v1/models/SLOOverallStatuses.ts @@ -0,0 +1,96 @@ +/** + * 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. + */ +import { SLORawErrorBudgetRemaining } from "./SLORawErrorBudgetRemaining"; +import { SLOTimeframe } from "./SLOTimeframe"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Overall status of the SLO by timeframes. + */ +export class SLOOverallStatuses { + /** + * Error message if SLO status or error budget could not be calculated. + */ + "error"?: string; + /** + * timestamp (UNIX time in seconds) of when the SLO status and error budget + * were calculated. + */ + "indexedAt"?: number; + /** + * Error budget remaining for an SLO. + */ + "rawErrorBudgetRemaining"?: SLORawErrorBudgetRemaining; + /** + * The amount of decimal places the SLI value is accurate to. + */ + "spanPrecision"?: number; + /** + * The status of the SLO. + */ + "status"?: number; + /** + * The target of the SLO. + */ + "target"?: number; + /** + * The SLO time window options. + */ + "timeframe"?: SLOTimeframe; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + error: { + baseName: "error", + type: "string", + }, + indexedAt: { + baseName: "indexed_at", + type: "number", + format: "int64", + }, + rawErrorBudgetRemaining: { + baseName: "raw_error_budget_remaining", + type: "SLORawErrorBudgetRemaining", + }, + spanPrecision: { + baseName: "span_precision", + type: "number", + format: "int64", + }, + status: { + baseName: "status", + type: "number", + format: "double", + }, + target: { + baseName: "target", + type: "number", + format: "double", + }, + timeframe: { + baseName: "timeframe", + type: "SLOTimeframe", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SLOOverallStatuses.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/SLORawErrorBudgetRemaining.ts b/packages/datadog-api-client-v1/models/SLORawErrorBudgetRemaining.ts new file mode 100644 index 000000000000..0f85f4633bcc --- /dev/null +++ b/packages/datadog-api-client-v1/models/SLORawErrorBudgetRemaining.ts @@ -0,0 +1,50 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Error budget remaining for an SLO. + */ +export class SLORawErrorBudgetRemaining { + /** + * Error budget remaining unit. + */ + "unit"?: string; + /** + * Error budget remaining value. + */ + "value"?: number; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + unit: { + baseName: "unit", + type: "string", + }, + value: { + baseName: "value", + type: "number", + format: "double", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SLORawErrorBudgetRemaining.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/SearchSLOQuery.ts b/packages/datadog-api-client-v1/models/SearchSLOQuery.ts new file mode 100644 index 000000000000..850ef924f113 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SearchSLOQuery.ts @@ -0,0 +1,60 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator + * to be used because this will sum up all request counts instead of averaging them, or taking the max or + * min of all of those requests. + */ +export class SearchSLOQuery { + /** + * A Datadog metric query for total (valid) events. + */ + "denominator"?: string; + /** + * Metric names used in the query's numerator and denominator. + * This field will return null and will be implemented in the next version of this endpoint. + */ + "metrics"?: Array; + /** + * A Datadog metric query for good events. + */ + "numerator"?: string; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + denominator: { + baseName: "denominator", + type: "string", + }, + metrics: { + baseName: "metrics", + type: "Array", + }, + numerator: { + baseName: "numerator", + type: "string", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SearchSLOQuery.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/SearchSLOResponseDataAttributes.ts b/packages/datadog-api-client-v1/models/SearchSLOResponseDataAttributes.ts index a2ea120e4720..7285b2f158af 100644 --- a/packages/datadog-api-client-v1/models/SearchSLOResponseDataAttributes.ts +++ b/packages/datadog-api-client-v1/models/SearchSLOResponseDataAttributes.ts @@ -3,8 +3,8 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ +import { SearchServiceLevelObjective } from "./SearchServiceLevelObjective"; import { SearchSLOResponseDataAttributesFacets } from "./SearchSLOResponseDataAttributesFacets"; -import { ServiceLevelObjective } from "./ServiceLevelObjective"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -19,7 +19,7 @@ export class SearchSLOResponseDataAttributes { /** * SLOs */ - "slo"?: Array; + "slo"?: Array; /** * @ignore @@ -36,7 +36,7 @@ export class SearchSLOResponseDataAttributes { }, slo: { baseName: "slo", - type: "Array", + type: "Array", }, }; diff --git a/packages/datadog-api-client-v1/models/SearchSLOThreshold.ts b/packages/datadog-api-client-v1/models/SearchSLOThreshold.ts new file mode 100644 index 000000000000..ddf1e1a9b582 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SearchSLOThreshold.ts @@ -0,0 +1,87 @@ +/** + * 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. + */ +import { SearchSLOTimeframe } from "./SearchSLOTimeframe"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * SLO thresholds (target and optionally warning) for a single time window. + */ +export class SearchSLOThreshold { + /** + * The target value for the service level indicator within the corresponding + * timeframe. + */ + "target": number; + /** + * A string representation of the target that indicates its precision. + * It uses trailing zeros to show significant decimal places (for example `98.00`). + * + * Always included in service level objective responses. Ignored in + * create/update requests. + */ + "targetDisplay"?: string; + /** + * The SLO time window options. + */ + "timeframe": SearchSLOTimeframe; + /** + * The warning value for the service level objective. + */ + "warning"?: number; + /** + * A string representation of the warning target (see the description of + * the `target_display` field for details). + * + * Included in service level objective responses if a warning target exists. + * Ignored in create/update requests. + */ + "warningDisplay"?: string; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + target: { + baseName: "target", + type: "number", + required: true, + format: "double", + }, + targetDisplay: { + baseName: "target_display", + type: "string", + }, + timeframe: { + baseName: "timeframe", + type: "SearchSLOTimeframe", + required: true, + }, + warning: { + baseName: "warning", + type: "number", + format: "double", + }, + warningDisplay: { + baseName: "warning_display", + type: "string", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SearchSLOThreshold.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/SearchSLOTimeframe.ts b/packages/datadog-api-client-v1/models/SearchSLOTimeframe.ts new file mode 100644 index 000000000000..9b0c538a96cf --- /dev/null +++ b/packages/datadog-api-client-v1/models/SearchSLOTimeframe.ts @@ -0,0 +1,13 @@ +/** + * 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. + */ + +export type SearchSLOTimeframe = + | typeof SEVEN_DAYS + | typeof THIRTY_DAYS + | typeof NINETY_DAYS; +export const SEVEN_DAYS = "7d"; +export const THIRTY_DAYS = "30d"; +export const NINETY_DAYS = "90d"; diff --git a/packages/datadog-api-client-v1/models/SearchServiceLevelObjective.ts b/packages/datadog-api-client-v1/models/SearchServiceLevelObjective.ts new file mode 100644 index 000000000000..a7b88e842f2a --- /dev/null +++ b/packages/datadog-api-client-v1/models/SearchServiceLevelObjective.ts @@ -0,0 +1,165 @@ +/** + * 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. + */ +import { SearchSLOQuery } from "./SearchSLOQuery"; +import { SearchSLOThreshold } from "./SearchSLOThreshold"; +import { SLOCreator } from "./SLOCreator"; +import { SLOOverallStatuses } from "./SLOOverallStatuses"; +import { SLOType } from "./SLOType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A service level objective object includes a service level indicator, thresholds + * for one or more timeframes, and metadata (`name`, `description`, `tags`, etc.). + */ +export class SearchServiceLevelObjective { + /** + * A list of tags associated with this service level objective. + * Always included in service level objective responses (but may be empty). + * Optional in create/update requests. + */ + "allTags"?: Array; + /** + * Creation timestamp (UNIX time in seconds) + * + * Always included in service level objective responses. + */ + "createdAt"?: number; + /** + * The creator of the SLO + */ + "creator"?: SLOCreator; + /** + * A user-defined description of the service level objective. + * + * Always included in service level objective responses (but may be `null`). + * Optional in create/update requests. + */ + "description"?: string; + /** + * A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. + * + * Included in service level objective responses if it is not empty. Optional in + * create/update requests for monitor service level objectives, but may only be + * used when then length of the `monitor_ids` field is one. + */ + "groups"?: Array; + /** + * A unique identifier for the service level objective object. + * + * Always included in service level objective responses. + */ + "id"?: string; + /** + * Modification timestamp (UNIX time in seconds) + * + * Always included in service level objective responses. + */ + "modifiedAt"?: number; + /** + * A list of monitor ids that defines the scope of a monitor service level + * objective. **Required if type is `monitor`**. + */ + "monitorIds"?: Array; + /** + * The name of the service level objective object. + */ + "name"?: string; + /** + * calculated status and error budget remaining. + */ + "overallStatus"?: Array; + /** + * A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator + * to be used because this will sum up all request counts instead of averaging them, or taking the max or + * min of all of those requests. + */ + "query"?: SearchSLOQuery; + /** + * The thresholds (timeframes and associated targets) for this service level + * objective object. + */ + "thresholds"?: Array; + /** + * The type of the service level objective. + */ + "type"?: SLOType; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + allTags: { + baseName: "all_tags", + type: "Array", + }, + createdAt: { + baseName: "created_at", + type: "number", + format: "int64", + }, + creator: { + baseName: "creator", + type: "SLOCreator", + }, + description: { + baseName: "description", + type: "string", + }, + groups: { + baseName: "groups", + type: "Array", + }, + id: { + baseName: "id", + type: "string", + }, + modifiedAt: { + baseName: "modified_at", + type: "number", + format: "int64", + }, + monitorIds: { + baseName: "monitor_ids", + type: "Array", + format: "int64", + }, + name: { + baseName: "name", + type: "string", + }, + overallStatus: { + baseName: "overall_status", + type: "Array", + }, + query: { + baseName: "query", + type: "SearchSLOQuery", + }, + thresholds: { + baseName: "thresholds", + type: "Array", + }, + type: { + baseName: "type", + type: "SLOType", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SearchServiceLevelObjective.attributeTypeMap; + } + + public constructor() {} +} From f4e0f5ca4409b83cb86c2fabd1a71974e7b7ff97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Wed, 14 Sep 2022 11:02:33 +0200 Subject: [PATCH 12/30] Fix date calculation in examples (#837) The constructor takes ms not seconds. --- .generator/conftest.py | 12 ++++++------ examples/v1/downtimes/CreateDowntime.ts | 2 +- examples/v1/downtimes/CreateDowntime_1393233946.ts | 2 +- examples/v1/downtimes/CreateDowntime_2908359488.ts | 4 ++-- examples/v1/downtimes/CreateDowntime_3059354445.ts | 2 +- examples/v1/logs/ListLogs_235998668.ts | 2 +- examples/v1/metrics/QueryMetrics.ts | 2 +- .../CreateSLOCorrection.ts | 2 +- .../UpdateSLOCorrection.ts | 2 +- .../v1/service-level-objectives/GetSLOHistory.ts | 2 +- examples/v1/snapshots/GetGraphSnapshot.ts | 2 +- .../v1/usage-metering/GetHourlyUsageAttribution.ts | 2 +- examples/v1/usage-metering/GetIncidentManagement.ts | 4 ++-- examples/v1/usage-metering/GetIngestedSpans.ts | 4 ++-- .../v1/usage-metering/GetMonthlyUsageAttribution.ts | 2 +- .../GetMonthlyUsageAttribution_3849653599.ts | 2 +- examples/v1/usage-metering/GetUsageAnalyzedLogs.ts | 4 ++-- examples/v1/usage-metering/GetUsageAttribution.ts | 2 +- examples/v1/usage-metering/GetUsageAuditLogs.ts | 4 ++-- .../v1/usage-metering/GetUsageCIApp_1064440884.ts | 4 ++-- examples/v1/usage-metering/GetUsageCWS_736958514.ts | 4 ++-- .../GetUsageCloudSecurityPostureManagement.ts | 2 +- examples/v1/usage-metering/GetUsageDBM_3446806203.ts | 4 ++-- examples/v1/usage-metering/GetUsageFargate.ts | 4 ++-- examples/v1/usage-metering/GetUsageHosts.ts | 4 ++-- examples/v1/usage-metering/GetUsageIndexedSpans.ts | 4 ++-- .../v1/usage-metering/GetUsageInternetOfThings.ts | 4 ++-- .../v1/usage-metering/GetUsageLambda_3132428705.ts | 4 ++-- .../usage-metering/GetUsageLogsByIndex_1025184776.ts | 4 ++-- .../v1/usage-metering/GetUsageLogsByRetention.ts | 4 ++-- .../v1/usage-metering/GetUsageLogs_2562396405.ts | 4 ++-- .../GetUsageNetworkFlows_1239422069.ts | 4 ++-- .../GetUsageNetworkHosts_1249907835.ts | 4 ++-- .../GetUsageOnlineArchive_1501172903.ts | 4 ++-- examples/v1/usage-metering/GetUsageProfiling.ts | 4 ++-- .../usage-metering/GetUsageRumSessions_3271366243.ts | 4 ++-- .../usage-metering/GetUsageRumSessions_714937291.ts | 4 ++-- .../v1/usage-metering/GetUsageRumUnits_3959755399.ts | 4 ++-- examples/v1/usage-metering/GetUsageSDS_271128478.ts | 4 ++-- examples/v1/usage-metering/GetUsageSNMP.ts | 4 ++-- .../GetUsageSyntheticsAPI_4048033529.ts | 4 ++-- .../GetUsageSyntheticsBrowser_1704663299.ts | 4 ++-- examples/v1/usage-metering/GetUsageTimeseries.ts | 4 ++-- examples/v1/usage-metering/GetUsageTopAvgMetrics.ts | 2 +- .../SearchSecurityMonitoringSignals_1309350146.ts | 2 +- examples/v2/usage-metering/GetCostByOrg.ts | 2 +- .../GetEstimatedCostByOrg_2734954020.ts | 2 +- .../GetEstimatedCostByOrg_3186693804.ts | 2 +- examples/v2/usage-metering/GetHourlyUsage.ts | 2 +- ...tUsageApplicationSecurityMonitoring_3959166796.ts | 4 ++-- .../GetUsageLambdaTracedInvocations_1436752065.ts | 4 ++-- .../GetUsageObservabilityPipelines_970725512.ts | 4 ++-- 52 files changed, 88 insertions(+), 88 deletions(-) diff --git a/.generator/conftest.py b/.generator/conftest.py index 081b13939e59..00e95e8ec531 100644 --- a/.generator/conftest.py +++ b/.generator/conftest.py @@ -140,12 +140,12 @@ def unique(request): "timestamp": "Math.round({sret}.getTime() / 1000)", "isoformat": "{sret}", "units": { - "s": "new Date(new Date().getTime() / 1000 + {num})", - "m": "new Date(new Date().getTime() / 1000 + {num}*60)", - "h": "new Date(new Date().getTime() / 1000 + {num}*3600)", - "d": "new Date(new Date().getTime() / 1000 + {num}*86400)", - "M": "new Date(new Date().getTime() / 1000 + {num}*86400*30)", - "y": "new Date(new Date().getTime() / 1000 + {num}*86400*365)", + "s": "new Date(new Date().getTime() + {num}*1000)", + "m": "new Date(new Date().getTime() + {num}*60*1000)", + "h": "new Date(new Date().getTime() + {num}*3600*1000)", + "d": "new Date(new Date().getTime() + {num}*86400*1000)", + "M": "new Date(new Date().getTime() + {num}*86400*30*1000)", + "y": "new Date(new Date().getTime() + {num}*86400*365*1000)", }, } diff --git a/examples/v1/downtimes/CreateDowntime.ts b/examples/v1/downtimes/CreateDowntime.ts index 0fb0ebd2e2c8..f4361468feb9 100644 --- a/examples/v1/downtimes/CreateDowntime.ts +++ b/examples/v1/downtimes/CreateDowntime.ts @@ -18,7 +18,7 @@ const params: v1.DowntimesApiCreateDowntimeRequest = { period: 1, weekDays: ["Mon", "Tue", "Wed", "Thu", "Fri"], untilDate: Math.round( - new Date(new Date().getTime() / 1000 + 21 * 86400).getTime() / 1000 + new Date(new Date().getTime() + 21 * 86400 * 1000).getTime() / 1000 ), }, }, diff --git a/examples/v1/downtimes/CreateDowntime_1393233946.ts b/examples/v1/downtimes/CreateDowntime_1393233946.ts index a7bc496a667a..d881104b922f 100644 --- a/examples/v1/downtimes/CreateDowntime_1393233946.ts +++ b/examples/v1/downtimes/CreateDowntime_1393233946.ts @@ -19,7 +19,7 @@ const params: v1.DowntimesApiCreateDowntimeRequest = { scope: ["*"], start: Math.round(new Date().getTime() / 1000), end: Math.round( - new Date(new Date().getTime() / 1000 + 1 * 3600).getTime() / 1000 + new Date(new Date().getTime() + 1 * 3600 * 1000).getTime() / 1000 ), timezone: "Etc/UTC", monitorTags: ["tag0"], diff --git a/examples/v1/downtimes/CreateDowntime_2908359488.ts b/examples/v1/downtimes/CreateDowntime_2908359488.ts index 6e5706a14c0f..ae6547f59b79 100644 --- a/examples/v1/downtimes/CreateDowntime_2908359488.ts +++ b/examples/v1/downtimes/CreateDowntime_2908359488.ts @@ -14,14 +14,14 @@ const params: v1.DowntimesApiCreateDowntimeRequest = { period: 1, type: "weeks", untilDate: Math.round( - new Date(new Date().getTime() / 1000 + 21 * 86400).getTime() / 1000 + new Date(new Date().getTime() + 21 * 86400 * 1000).getTime() / 1000 ), weekDays: ["Mon", "Tue", "Wed", "Thu", "Fri"], }, scope: ["*"], start: Math.round(new Date().getTime() / 1000), end: Math.round( - new Date(new Date().getTime() / 1000 + 1 * 3600).getTime() / 1000 + new Date(new Date().getTime() + 1 * 3600 * 1000).getTime() / 1000 ), timezone: "Etc/UTC", muteFirstRecoveryNotification: true, diff --git a/examples/v1/downtimes/CreateDowntime_3059354445.ts b/examples/v1/downtimes/CreateDowntime_3059354445.ts index 40d5512812a0..801756e400fc 100644 --- a/examples/v1/downtimes/CreateDowntime_3059354445.ts +++ b/examples/v1/downtimes/CreateDowntime_3059354445.ts @@ -17,7 +17,7 @@ const params: v1.DowntimesApiCreateDowntimeRequest = { scope: ["*"], start: Math.round(new Date().getTime() / 1000), end: Math.round( - new Date(new Date().getTime() / 1000 + 1 * 3600).getTime() / 1000 + new Date(new Date().getTime() + 1 * 3600 * 1000).getTime() / 1000 ), timezone: "Etc/UTC", muteFirstRecoveryNotification: true, diff --git a/examples/v1/logs/ListLogs_235998668.ts b/examples/v1/logs/ListLogs_235998668.ts index 39c3663f66d2..eef5c7e12ce9 100644 --- a/examples/v1/logs/ListLogs_235998668.ts +++ b/examples/v1/logs/ListLogs_235998668.ts @@ -13,7 +13,7 @@ const params: v1.LogsApiListLogsRequest = { query: "host:Test*", sort: "asc", time: { - from: new Date(new Date().getTime() / 1000 + -1 * 3600), + from: new Date(new Date().getTime() + -1 * 3600 * 1000), timezone: "Europe/Paris", to: new Date(), }, diff --git a/examples/v1/metrics/QueryMetrics.ts b/examples/v1/metrics/QueryMetrics.ts index c163b0307655..a22f705c3b09 100644 --- a/examples/v1/metrics/QueryMetrics.ts +++ b/examples/v1/metrics/QueryMetrics.ts @@ -9,7 +9,7 @@ const apiInstance = new v1.MetricsApi(configuration); const params: v1.MetricsApiQueryMetricsRequest = { from: Math.round( - new Date(new Date().getTime() / 1000 + -1 * 86400).getTime() / 1000 + new Date(new Date().getTime() + -1 * 86400 * 1000).getTime() / 1000 ), to: Math.round(new Date().getTime() / 1000), query: "system.cpu.idle{*}", diff --git a/examples/v1/service-level-objective-corrections/CreateSLOCorrection.ts b/examples/v1/service-level-objective-corrections/CreateSLOCorrection.ts index 34deb52f7eab..c6befb466cdf 100644 --- a/examples/v1/service-level-objective-corrections/CreateSLOCorrection.ts +++ b/examples/v1/service-level-objective-corrections/CreateSLOCorrection.ts @@ -18,7 +18,7 @@ const params: v1.ServiceLevelObjectiveCorrectionsApiCreateSLOCorrectionRequest = category: "Scheduled Maintenance", description: "Example-Create_an_SLO_correction_returns_OK_response", end: Math.round( - new Date(new Date().getTime() / 1000 + 1 * 3600).getTime() / 1000 + new Date(new Date().getTime() + 1 * 3600 * 1000).getTime() / 1000 ), sloId: SLO_DATA_0_ID, start: Math.round(new Date().getTime() / 1000), diff --git a/examples/v1/service-level-objective-corrections/UpdateSLOCorrection.ts b/examples/v1/service-level-objective-corrections/UpdateSLOCorrection.ts index f298835ee170..7d96243efdaa 100644 --- a/examples/v1/service-level-objective-corrections/UpdateSLOCorrection.ts +++ b/examples/v1/service-level-objective-corrections/UpdateSLOCorrection.ts @@ -18,7 +18,7 @@ const params: v1.ServiceLevelObjectiveCorrectionsApiUpdateSLOCorrectionRequest = category: "Deployment", description: "Example-Update_an_SLO_correction_returns_OK_response", end: Math.round( - new Date(new Date().getTime() / 1000 + 1 * 3600).getTime() / 1000 + new Date(new Date().getTime() + 1 * 3600 * 1000).getTime() / 1000 ), start: Math.round(new Date().getTime() / 1000), timezone: "UTC", diff --git a/examples/v1/service-level-objectives/GetSLOHistory.ts b/examples/v1/service-level-objectives/GetSLOHistory.ts index 64db968ccf6f..f0d20b2844e7 100644 --- a/examples/v1/service-level-objectives/GetSLOHistory.ts +++ b/examples/v1/service-level-objectives/GetSLOHistory.ts @@ -14,7 +14,7 @@ const SLO_DATA_0_ID = process.env.SLO_DATA_0_ID as string; const params: v1.ServiceLevelObjectivesApiGetSLOHistoryRequest = { sloId: SLO_DATA_0_ID, fromTs: Math.round( - new Date(new Date().getTime() / 1000 + -1 * 86400).getTime() / 1000 + new Date(new Date().getTime() + -1 * 86400 * 1000).getTime() / 1000 ), toTs: Math.round(new Date().getTime() / 1000), }; diff --git a/examples/v1/snapshots/GetGraphSnapshot.ts b/examples/v1/snapshots/GetGraphSnapshot.ts index b1084d058638..0b7e9b2e7498 100644 --- a/examples/v1/snapshots/GetGraphSnapshot.ts +++ b/examples/v1/snapshots/GetGraphSnapshot.ts @@ -10,7 +10,7 @@ const apiInstance = new v1.SnapshotsApi(configuration); const params: v1.SnapshotsApiGetGraphSnapshotRequest = { metricQuery: "avg:system.load.1{*}", start: Math.round( - new Date(new Date().getTime() / 1000 + -1 * 86400).getTime() / 1000 + new Date(new Date().getTime() + -1 * 86400 * 1000).getTime() / 1000 ), end: Math.round(new Date().getTime() / 1000), title: "System load", diff --git a/examples/v1/usage-metering/GetHourlyUsageAttribution.ts b/examples/v1/usage-metering/GetHourlyUsageAttribution.ts index de9f3b39af06..189577f75284 100644 --- a/examples/v1/usage-metering/GetHourlyUsageAttribution.ts +++ b/examples/v1/usage-metering/GetHourlyUsageAttribution.ts @@ -8,7 +8,7 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetHourlyUsageAttributionRequest = { - startHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -3 * 86400 * 1000), usageType: "infra_host_usage", }; diff --git a/examples/v1/usage-metering/GetIncidentManagement.ts b/examples/v1/usage-metering/GetIncidentManagement.ts index 047981b4a7e4..0efca1c74569 100644 --- a/examples/v1/usage-metering/GetIncidentManagement.ts +++ b/examples/v1/usage-metering/GetIncidentManagement.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetIncidentManagementRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetIngestedSpans.ts b/examples/v1/usage-metering/GetIngestedSpans.ts index 84e90761bde2..306b92f23861 100644 --- a/examples/v1/usage-metering/GetIngestedSpans.ts +++ b/examples/v1/usage-metering/GetIngestedSpans.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetIngestedSpansRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetMonthlyUsageAttribution.ts b/examples/v1/usage-metering/GetMonthlyUsageAttribution.ts index 3362efd2baf4..d025bbf94a28 100644 --- a/examples/v1/usage-metering/GetMonthlyUsageAttribution.ts +++ b/examples/v1/usage-metering/GetMonthlyUsageAttribution.ts @@ -8,7 +8,7 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetMonthlyUsageAttributionRequest = { - startMonth: new Date(new Date().getTime() / 1000 + -3 * 86400), + startMonth: new Date(new Date().getTime() + -3 * 86400 * 1000), fields: "infra_host_usage", }; diff --git a/examples/v1/usage-metering/GetMonthlyUsageAttribution_3849653599.ts b/examples/v1/usage-metering/GetMonthlyUsageAttribution_3849653599.ts index 2aa69a97523f..24894f8c87f7 100644 --- a/examples/v1/usage-metering/GetMonthlyUsageAttribution_3849653599.ts +++ b/examples/v1/usage-metering/GetMonthlyUsageAttribution_3849653599.ts @@ -12,7 +12,7 @@ const MONTHLY_USAGE_ATTRIBUTION_METADATA_PAGINATION_NEXT_RECORD_ID = process.env .MONTHLY_USAGE_ATTRIBUTION_METADATA_PAGINATION_NEXT_RECORD_ID as string; const params: v1.UsageMeteringApiGetMonthlyUsageAttributionRequest = { - startMonth: new Date(new Date().getTime() / 1000 + -3 * 86400), + startMonth: new Date(new Date().getTime() + -3 * 86400 * 1000), fields: "infra_host_usage", nextRecordId: MONTHLY_USAGE_ATTRIBUTION_METADATA_PAGINATION_NEXT_RECORD_ID, }; diff --git a/examples/v1/usage-metering/GetUsageAnalyzedLogs.ts b/examples/v1/usage-metering/GetUsageAnalyzedLogs.ts index f488a6766b1f..fe704eaf4006 100644 --- a/examples/v1/usage-metering/GetUsageAnalyzedLogs.ts +++ b/examples/v1/usage-metering/GetUsageAnalyzedLogs.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageAnalyzedLogsRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageAttribution.ts b/examples/v1/usage-metering/GetUsageAttribution.ts index a2922ac56c62..787c16c3fb36 100644 --- a/examples/v1/usage-metering/GetUsageAttribution.ts +++ b/examples/v1/usage-metering/GetUsageAttribution.ts @@ -8,7 +8,7 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageAttributionRequest = { - startMonth: new Date(new Date().getTime() / 1000 + -3 * 86400), + startMonth: new Date(new Date().getTime() + -3 * 86400 * 1000), fields: "*", offset: 0, limit: 1, diff --git a/examples/v1/usage-metering/GetUsageAuditLogs.ts b/examples/v1/usage-metering/GetUsageAuditLogs.ts index bea921425298..fb0d7a567950 100644 --- a/examples/v1/usage-metering/GetUsageAuditLogs.ts +++ b/examples/v1/usage-metering/GetUsageAuditLogs.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageAuditLogsRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageCIApp_1064440884.ts b/examples/v1/usage-metering/GetUsageCIApp_1064440884.ts index 48e197425eec..a8412032d8d6 100644 --- a/examples/v1/usage-metering/GetUsageCIApp_1064440884.ts +++ b/examples/v1/usage-metering/GetUsageCIApp_1064440884.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageCIAppRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageCWS_736958514.ts b/examples/v1/usage-metering/GetUsageCWS_736958514.ts index 5147fda6560f..0c1044a9f432 100644 --- a/examples/v1/usage-metering/GetUsageCWS_736958514.ts +++ b/examples/v1/usage-metering/GetUsageCWS_736958514.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageCWSRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageCloudSecurityPostureManagement.ts b/examples/v1/usage-metering/GetUsageCloudSecurityPostureManagement.ts index 4edc6a00df21..26401b05e004 100644 --- a/examples/v1/usage-metering/GetUsageCloudSecurityPostureManagement.ts +++ b/examples/v1/usage-metering/GetUsageCloudSecurityPostureManagement.ts @@ -9,7 +9,7 @@ const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageCloudSecurityPostureManagementRequest = { - startHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageDBM_3446806203.ts b/examples/v1/usage-metering/GetUsageDBM_3446806203.ts index d19344eb47e3..06d60ea8dfa5 100644 --- a/examples/v1/usage-metering/GetUsageDBM_3446806203.ts +++ b/examples/v1/usage-metering/GetUsageDBM_3446806203.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageDBMRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageFargate.ts b/examples/v1/usage-metering/GetUsageFargate.ts index 01243b790114..c714101f37b8 100644 --- a/examples/v1/usage-metering/GetUsageFargate.ts +++ b/examples/v1/usage-metering/GetUsageFargate.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageFargateRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageHosts.ts b/examples/v1/usage-metering/GetUsageHosts.ts index df91ae2419f4..0dc9dbda199d 100644 --- a/examples/v1/usage-metering/GetUsageHosts.ts +++ b/examples/v1/usage-metering/GetUsageHosts.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageHostsRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageIndexedSpans.ts b/examples/v1/usage-metering/GetUsageIndexedSpans.ts index 14ac1d5f29d0..7c3fb10ec963 100644 --- a/examples/v1/usage-metering/GetUsageIndexedSpans.ts +++ b/examples/v1/usage-metering/GetUsageIndexedSpans.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageIndexedSpansRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageInternetOfThings.ts b/examples/v1/usage-metering/GetUsageInternetOfThings.ts index 7d0d76cf876d..e996e1620e14 100644 --- a/examples/v1/usage-metering/GetUsageInternetOfThings.ts +++ b/examples/v1/usage-metering/GetUsageInternetOfThings.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageInternetOfThingsRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageLambda_3132428705.ts b/examples/v1/usage-metering/GetUsageLambda_3132428705.ts index f6c1c2824d12..22679f9bb598 100644 --- a/examples/v1/usage-metering/GetUsageLambda_3132428705.ts +++ b/examples/v1/usage-metering/GetUsageLambda_3132428705.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageLambdaRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageLogsByIndex_1025184776.ts b/examples/v1/usage-metering/GetUsageLogsByIndex_1025184776.ts index 4b086b15357d..2f5e9364bab1 100644 --- a/examples/v1/usage-metering/GetUsageLogsByIndex_1025184776.ts +++ b/examples/v1/usage-metering/GetUsageLogsByIndex_1025184776.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageLogsByIndexRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageLogsByRetention.ts b/examples/v1/usage-metering/GetUsageLogsByRetention.ts index a9b29ec90289..6b32f36330c4 100644 --- a/examples/v1/usage-metering/GetUsageLogsByRetention.ts +++ b/examples/v1/usage-metering/GetUsageLogsByRetention.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageLogsByRetentionRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageLogs_2562396405.ts b/examples/v1/usage-metering/GetUsageLogs_2562396405.ts index d69add3c9751..4fc7de045403 100644 --- a/examples/v1/usage-metering/GetUsageLogs_2562396405.ts +++ b/examples/v1/usage-metering/GetUsageLogs_2562396405.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageLogsRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageNetworkFlows_1239422069.ts b/examples/v1/usage-metering/GetUsageNetworkFlows_1239422069.ts index 90eaeb28bcff..4b5daf202d8a 100644 --- a/examples/v1/usage-metering/GetUsageNetworkFlows_1239422069.ts +++ b/examples/v1/usage-metering/GetUsageNetworkFlows_1239422069.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageNetworkFlowsRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageNetworkHosts_1249907835.ts b/examples/v1/usage-metering/GetUsageNetworkHosts_1249907835.ts index c459a15f3d14..b9a1d9cd706f 100644 --- a/examples/v1/usage-metering/GetUsageNetworkHosts_1249907835.ts +++ b/examples/v1/usage-metering/GetUsageNetworkHosts_1249907835.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageNetworkHostsRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageOnlineArchive_1501172903.ts b/examples/v1/usage-metering/GetUsageOnlineArchive_1501172903.ts index 2aa5f99df518..217a05d2eba1 100644 --- a/examples/v1/usage-metering/GetUsageOnlineArchive_1501172903.ts +++ b/examples/v1/usage-metering/GetUsageOnlineArchive_1501172903.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageOnlineArchiveRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageProfiling.ts b/examples/v1/usage-metering/GetUsageProfiling.ts index 0927ea85865e..eeb9c548f60b 100644 --- a/examples/v1/usage-metering/GetUsageProfiling.ts +++ b/examples/v1/usage-metering/GetUsageProfiling.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageProfilingRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageRumSessions_3271366243.ts b/examples/v1/usage-metering/GetUsageRumSessions_3271366243.ts index 56d9f066f496..d9e3bc8fd9c1 100644 --- a/examples/v1/usage-metering/GetUsageRumSessions_3271366243.ts +++ b/examples/v1/usage-metering/GetUsageRumSessions_3271366243.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageRumSessionsRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), type: "mobile", }; diff --git a/examples/v1/usage-metering/GetUsageRumSessions_714937291.ts b/examples/v1/usage-metering/GetUsageRumSessions_714937291.ts index 5cf11d537057..4d5473de91f1 100644 --- a/examples/v1/usage-metering/GetUsageRumSessions_714937291.ts +++ b/examples/v1/usage-metering/GetUsageRumSessions_714937291.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageRumSessionsRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageRumUnits_3959755399.ts b/examples/v1/usage-metering/GetUsageRumUnits_3959755399.ts index 09db7a7f3507..973a61c10af8 100644 --- a/examples/v1/usage-metering/GetUsageRumUnits_3959755399.ts +++ b/examples/v1/usage-metering/GetUsageRumUnits_3959755399.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageRumUnitsRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageSDS_271128478.ts b/examples/v1/usage-metering/GetUsageSDS_271128478.ts index 7f439e19fa27..fb51e13cd3f3 100644 --- a/examples/v1/usage-metering/GetUsageSDS_271128478.ts +++ b/examples/v1/usage-metering/GetUsageSDS_271128478.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageSDSRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageSNMP.ts b/examples/v1/usage-metering/GetUsageSNMP.ts index 9027cfd8e6dc..a16b39fbbc8a 100644 --- a/examples/v1/usage-metering/GetUsageSNMP.ts +++ b/examples/v1/usage-metering/GetUsageSNMP.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageSNMPRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageSyntheticsAPI_4048033529.ts b/examples/v1/usage-metering/GetUsageSyntheticsAPI_4048033529.ts index 54db938e6ade..5c936969cb32 100644 --- a/examples/v1/usage-metering/GetUsageSyntheticsAPI_4048033529.ts +++ b/examples/v1/usage-metering/GetUsageSyntheticsAPI_4048033529.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageSyntheticsAPIRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageSyntheticsBrowser_1704663299.ts b/examples/v1/usage-metering/GetUsageSyntheticsBrowser_1704663299.ts index 615e5f8cac93..fa4e1bd096e3 100644 --- a/examples/v1/usage-metering/GetUsageSyntheticsBrowser_1704663299.ts +++ b/examples/v1/usage-metering/GetUsageSyntheticsBrowser_1704663299.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageSyntheticsBrowserRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageTimeseries.ts b/examples/v1/usage-metering/GetUsageTimeseries.ts index b08911e8f808..d5ffab81e4c3 100644 --- a/examples/v1/usage-metering/GetUsageTimeseries.ts +++ b/examples/v1/usage-metering/GetUsageTimeseries.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageTimeseriesRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v1/usage-metering/GetUsageTopAvgMetrics.ts b/examples/v1/usage-metering/GetUsageTopAvgMetrics.ts index 71cdb644e7f5..f294a57cdded 100644 --- a/examples/v1/usage-metering/GetUsageTopAvgMetrics.ts +++ b/examples/v1/usage-metering/GetUsageTopAvgMetrics.ts @@ -8,7 +8,7 @@ const configuration = client.createConfiguration(); const apiInstance = new v1.UsageMeteringApi(configuration); const params: v1.UsageMeteringApiGetUsageTopAvgMetricsRequest = { - day: new Date(new Date().getTime() / 1000 + -3 * 86400), + day: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v2/security-monitoring/SearchSecurityMonitoringSignals_1309350146.ts b/examples/v2/security-monitoring/SearchSecurityMonitoringSignals_1309350146.ts index 3ebcf20268e7..36e1aec0d379 100644 --- a/examples/v2/security-monitoring/SearchSecurityMonitoringSignals_1309350146.ts +++ b/examples/v2/security-monitoring/SearchSecurityMonitoringSignals_1309350146.ts @@ -10,7 +10,7 @@ const apiInstance = new v2.SecurityMonitoringApi(configuration); const params: v2.SecurityMonitoringApiSearchSecurityMonitoringSignalsRequest = { body: { filter: { - from: new Date(new Date().getTime() / 1000 + -15 * 60), + from: new Date(new Date().getTime() + -15 * 60 * 1000), query: "security:attack status:high", to: new Date(), }, diff --git a/examples/v2/usage-metering/GetCostByOrg.ts b/examples/v2/usage-metering/GetCostByOrg.ts index c80a41e18e73..999256c25357 100644 --- a/examples/v2/usage-metering/GetCostByOrg.ts +++ b/examples/v2/usage-metering/GetCostByOrg.ts @@ -8,7 +8,7 @@ const configuration = client.createConfiguration(); const apiInstance = new v2.UsageMeteringApi(configuration); const params: v2.UsageMeteringApiGetCostByOrgRequest = { - startMonth: new Date(new Date().getTime() / 1000 + -3 * 86400), + startMonth: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.ts b/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.ts index 4c473118cb87..931331256ecb 100644 --- a/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.ts +++ b/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.ts @@ -10,7 +10,7 @@ const apiInstance = new v2.UsageMeteringApi(configuration); const params: v2.UsageMeteringApiGetEstimatedCostByOrgRequest = { view: "sub-org", - startDate: new Date(new Date().getTime() / 1000 + -5 * 86400), + startDate: new Date(new Date().getTime() + -5 * 86400 * 1000), }; apiInstance diff --git a/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.ts b/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.ts index ff83673ee8be..cbbb5608dc3a 100644 --- a/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.ts +++ b/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.ts @@ -10,7 +10,7 @@ const apiInstance = new v2.UsageMeteringApi(configuration); const params: v2.UsageMeteringApiGetEstimatedCostByOrgRequest = { view: "sub-org", - startMonth: new Date(new Date().getTime() / 1000 + -5 * 86400), + startMonth: new Date(new Date().getTime() + -5 * 86400 * 1000), }; apiInstance diff --git a/examples/v2/usage-metering/GetHourlyUsage.ts b/examples/v2/usage-metering/GetHourlyUsage.ts index 7e13e0f558a8..3f8819ca2c99 100644 --- a/examples/v2/usage-metering/GetHourlyUsage.ts +++ b/examples/v2/usage-metering/GetHourlyUsage.ts @@ -8,7 +8,7 @@ const configuration = client.createConfiguration(); const apiInstance = new v2.UsageMeteringApi(configuration); const params: v2.UsageMeteringApiGetHourlyUsageRequest = { - filterTimestampStart: new Date(new Date().getTime() / 1000 + -3 * 86400), + filterTimestampStart: new Date(new Date().getTime() + -3 * 86400 * 1000), filterProductFamilies: "infra_hosts", }; diff --git a/examples/v2/usage-metering/GetUsageApplicationSecurityMonitoring_3959166796.ts b/examples/v2/usage-metering/GetUsageApplicationSecurityMonitoring_3959166796.ts index de483634fd77..80e63f9626b5 100644 --- a/examples/v2/usage-metering/GetUsageApplicationSecurityMonitoring_3959166796.ts +++ b/examples/v2/usage-metering/GetUsageApplicationSecurityMonitoring_3959166796.ts @@ -9,8 +9,8 @@ const apiInstance = new v2.UsageMeteringApi(configuration); const params: v2.UsageMeteringApiGetUsageApplicationSecurityMonitoringRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v2/usage-metering/GetUsageLambdaTracedInvocations_1436752065.ts b/examples/v2/usage-metering/GetUsageLambdaTracedInvocations_1436752065.ts index e9db4a7a3c69..ca50048f76a4 100644 --- a/examples/v2/usage-metering/GetUsageLambdaTracedInvocations_1436752065.ts +++ b/examples/v2/usage-metering/GetUsageLambdaTracedInvocations_1436752065.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v2.UsageMeteringApi(configuration); const params: v2.UsageMeteringApiGetUsageLambdaTracedInvocationsRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance diff --git a/examples/v2/usage-metering/GetUsageObservabilityPipelines_970725512.ts b/examples/v2/usage-metering/GetUsageObservabilityPipelines_970725512.ts index 936a34274a41..173b00870443 100644 --- a/examples/v2/usage-metering/GetUsageObservabilityPipelines_970725512.ts +++ b/examples/v2/usage-metering/GetUsageObservabilityPipelines_970725512.ts @@ -8,8 +8,8 @@ const configuration = client.createConfiguration(); const apiInstance = new v2.UsageMeteringApi(configuration); const params: v2.UsageMeteringApiGetUsageObservabilityPipelinesRequest = { - startHr: new Date(new Date().getTime() / 1000 + -5 * 86400), - endHr: new Date(new Date().getTime() / 1000 + -3 * 86400), + startHr: new Date(new Date().getTime() + -5 * 86400 * 1000), + endHr: new Date(new Date().getTime() + -3 * 86400 * 1000), }; apiInstance From 494f9e973d1ac2cfba4adbc09fbfe5c48cea35b7 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 12:01:24 +0200 Subject: [PATCH 13/30] Regenerate client from commit 4e5b7510 of spec repo (#824) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: Thomas Hervé --- .apigentools-info | 8 +-- .generator/schemas/v1/openapi.yaml | 50 +++++++++++++++++++ .../models/HourlyUsageAttributionUsageType.ts | 2 + ...MonthlyUsageAttributionSupportedMetrics.ts | 4 ++ .../models/MonthlyUsageAttributionValues.ts | 18 +++++++ .../models/ObjectSerializer.ts | 7 +++ .../models/UsageAttributionSort.ts | 6 ++- .../UsageAttributionSupportedMetrics.ts | 4 ++ .../models/UsageAttributionValues.ts | 18 +++++++ .../models/UsageFargateHour.ts | 9 ++++ .../models/UsageSummaryDate.ts | 9 ++++ .../models/UsageSummaryDateOrg.ts | 9 ++++ .../models/UsageSummaryResponse.ts | 9 ++++ 13 files changed, 148 insertions(+), 5 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 74cd8e48592d..28bbb6250693 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-13 07:28:13.750530", - "spec_repo_commit": "82fabb35" + "regenerated": "2022-09-14 07:52:45.759185", + "spec_repo_commit": "4e5b7510" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-13 07:28:13.767666", - "spec_repo_commit": "82fabb35" + "regenerated": "2022-09-14 07:52:45.775321", + "spec_repo_commit": "4e5b7510" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 3b423d98db4b..8260d4297873 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3627,6 +3627,7 @@ components: description: Supported products for hourly usage attribution requests. enum: - api_usage + - apm_fargate_usage - apm_host_usage - appsec_usage - browser_usage @@ -3654,6 +3655,7 @@ components: type: string x-enum-varnames: - API_USAGE + - APM_FARGATE_USAGE - APM_HOST_USAGE - APPSEC_USAGE - BROWSER_USAGE @@ -6875,6 +6877,8 @@ components: enum: - api_usage - api_percentage + - apm_fargate_usage + - apm_fargate_percentage - apm_host_usage - apm_host_percentage - appsec_usage @@ -6928,6 +6932,8 @@ components: x-enum-varnames: - API_USAGE - API_PERCENTAGE + - APM_FARGATE_USAGE + - APM_FARGATE_PERCENTAGE - APM_HOST_USAGE - APM_HOST_PERCENTAGE - APPSEC_USAGE @@ -6988,6 +6994,14 @@ components: description: The synthetic API test usage by tag(s). format: double type: number + apm_fargate_percentage: + description: The percentage of APM ECS Fargate task usage by tag(s). + format: double + type: number + apm_fargate_usage: + description: The APM ECS Fargate task usage by tag(s). + format: double + type: number apm_host_percentage: description: The percentage of APM host usage by tag(s). format: double @@ -14000,6 +14014,8 @@ components: - estimated_indexed_spans_percentage - estimated_ingested_spans_usage - estimated_ingested_spans_percentage + - apm_fargate_usage + - apm_fargate_percentage type: string x-enum-varnames: - API_PERCENTAGE @@ -14032,6 +14048,8 @@ components: - ESTIMATED_INDEXED_SPANS_PERCENTAGE - ESTIMATED_INGESTED_SPANS_USAGE - ESTIMATED_INGESTED_SPANS_PERCENTAGE + - APM_FARGATE_USAGE + - APM_FARGATE_PERCENTAGE UsageAttributionSupportedMetrics: description: Supported fields for usage attribution requests (valid requests contain one or more metrics, or `*` for all). @@ -14076,6 +14094,8 @@ components: - estimated_indexed_spans_percentage - estimated_ingested_spans_usage - estimated_ingested_spans_percentage + - apm_fargate_usage + - apm_fargate_percentage - '*' type: string x-enum-varnames: @@ -14119,6 +14139,8 @@ components: - ESTIMATED_INDEXED_SPANS_PERCENTAGE - ESTIMATED_INGESTED_SPANS_USAGE - ESTIMATED_INGESTED_SPANS_PERCENTAGE + - APM_FARGATE_USAGE + - APM_FARGATE_PERCENTAGE - ALL UsageAttributionTagNames: additionalProperties: @@ -14159,6 +14181,14 @@ components: description: The synthetic API test usage by tag(s). format: double type: number + apm_fargate_percentage: + description: The percentage of APM ECS Fargate task usage by tag(s). + format: double + type: number + apm_fargate_usage: + description: The APM ECS Fargate task usage by tag(s). + format: double + type: number apm_host_percentage: description: The percentage of APM host usage by tag(s). format: double @@ -14843,6 +14873,11 @@ components: UsageFargateHour: description: Number of Fargate tasks run and hourly usage. properties: + apm_fargate_count: + description: The high-water mark of APM ECS Fargate tasks during the given + hour. + format: int64 + type: integer avg_profiled_fargate_tasks: description: The average profiled task count for Fargate Profiling. format: int64 @@ -15645,6 +15680,11 @@ components: over all hours in the current date all organizations. format: int64 type: integer + apm_fargate_count_avg: + description: Shows the average of all APM ECS Fargate tasks over all hours + in the current date for all organizations. + format: int64 + type: integer apm_host_top99p: description: Shows the 99th percentile of all distinct APM hosts over all hours in the current date for all organizations. @@ -15975,6 +16015,11 @@ components: over all hours in the current date for the given org. format: int64 type: integer + apm_fargate_count_avg: + description: Shows the average of all APM ECS Fargate tasks over all hours + in the current months for the given org. + format: int64 + type: integer apm_host_top99p: description: Shows the 99th percentile of all distinct APM hosts over all hours in the current date for the given org. @@ -16308,6 +16353,11 @@ components: over all hours in the current months all organizations. format: int64 type: integer + apm_fargate_count_avg_sum: + description: Shows the average of all APM ECS Fargate tasks over all hours + in the current months for all organizations. + format: int64 + type: integer apm_host_top99p_sum: description: Shows the 99th percentile of all distinct APM hosts over all hours in the current months for all organizations. diff --git a/packages/datadog-api-client-v1/models/HourlyUsageAttributionUsageType.ts b/packages/datadog-api-client-v1/models/HourlyUsageAttributionUsageType.ts index 7e720c94ee56..1f3d5c246ca5 100644 --- a/packages/datadog-api-client-v1/models/HourlyUsageAttributionUsageType.ts +++ b/packages/datadog-api-client-v1/models/HourlyUsageAttributionUsageType.ts @@ -6,6 +6,7 @@ export type HourlyUsageAttributionUsageType = | typeof API_USAGE + | typeof APM_FARGATE_USAGE | typeof APM_HOST_USAGE | typeof APPSEC_USAGE | typeof BROWSER_USAGE @@ -31,6 +32,7 @@ export type HourlyUsageAttributionUsageType = | typeof PROFILED_HOST_USAGE | typeof SNMP_USAGE; export const API_USAGE = "api_usage"; +export const APM_FARGATE_USAGE = "apm_fargate_usage"; export const APM_HOST_USAGE = "apm_host_usage"; export const APPSEC_USAGE = "appsec_usage"; export const BROWSER_USAGE = "browser_usage"; diff --git a/packages/datadog-api-client-v1/models/MonthlyUsageAttributionSupportedMetrics.ts b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionSupportedMetrics.ts index be0e0767d4ce..f4134048b51c 100644 --- a/packages/datadog-api-client-v1/models/MonthlyUsageAttributionSupportedMetrics.ts +++ b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionSupportedMetrics.ts @@ -7,6 +7,8 @@ export type MonthlyUsageAttributionSupportedMetrics = | typeof API_USAGE | typeof API_PERCENTAGE + | typeof APM_FARGATE_USAGE + | typeof APM_FARGATE_PERCENTAGE | typeof APM_HOST_USAGE | typeof APM_HOST_PERCENTAGE | typeof APPSEC_USAGE @@ -58,6 +60,8 @@ export type MonthlyUsageAttributionSupportedMetrics = | typeof ALL; export const API_USAGE = "api_usage"; export const API_PERCENTAGE = "api_percentage"; +export const APM_FARGATE_USAGE = "apm_fargate_usage"; +export const APM_FARGATE_PERCENTAGE = "apm_fargate_percentage"; export const APM_HOST_USAGE = "apm_host_usage"; export const APM_HOST_PERCENTAGE = "apm_host_percentage"; export const APPSEC_USAGE = "appsec_usage"; diff --git a/packages/datadog-api-client-v1/models/MonthlyUsageAttributionValues.ts b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionValues.ts index 098ba524df85..10c793be38f3 100644 --- a/packages/datadog-api-client-v1/models/MonthlyUsageAttributionValues.ts +++ b/packages/datadog-api-client-v1/models/MonthlyUsageAttributionValues.ts @@ -18,6 +18,14 @@ export class MonthlyUsageAttributionValues { * The synthetic API test usage by tag(s). */ "apiUsage"?: number; + /** + * The percentage of APM ECS Fargate task usage by tag(s). + */ + "apmFargatePercentage"?: number; + /** + * The APM ECS Fargate task usage by tag(s). + */ + "apmFargateUsage"?: number; /** * The percentage of APM host usage by tag(s). */ @@ -182,6 +190,16 @@ export class MonthlyUsageAttributionValues { type: "number", format: "double", }, + apmFargatePercentage: { + baseName: "apm_fargate_percentage", + type: "number", + format: "double", + }, + apmFargateUsage: { + baseName: "apm_fargate_usage", + type: "number", + format: "double", + }, apmHostPercentage: { baseName: "apm_host_percentage", type: "number", diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index a317ceac8770..a77e00d0076f 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -664,6 +664,7 @@ const enumsMap: { [key: string]: any[] } = { HostMapWidgetDefinitionType: ["hostmap"], HourlyUsageAttributionUsageType: [ "api_usage", + "apm_fargate_usage", "apm_host_usage", "appsec_usage", "browser_usage", @@ -781,6 +782,8 @@ const enumsMap: { [key: string]: any[] } = { MonthlyUsageAttributionSupportedMetrics: [ "api_usage", "api_percentage", + "apm_fargate_usage", + "apm_fargate_percentage", "apm_host_usage", "apm_host_percentage", "appsec_usage", @@ -1130,6 +1133,8 @@ const enumsMap: { [key: string]: any[] } = { "estimated_indexed_spans_percentage", "estimated_ingested_spans_usage", "estimated_ingested_spans_percentage", + "apm_fargate_usage", + "apm_fargate_percentage", ], UsageAttributionSupportedMetrics: [ "custom_timeseries_usage", @@ -1172,6 +1177,8 @@ const enumsMap: { [key: string]: any[] } = { "estimated_indexed_spans_percentage", "estimated_ingested_spans_usage", "estimated_ingested_spans_percentage", + "apm_fargate_usage", + "apm_fargate_percentage", "*", ], UsageMetricCategory: ["standard", "custom"], diff --git a/packages/datadog-api-client-v1/models/UsageAttributionSort.ts b/packages/datadog-api-client-v1/models/UsageAttributionSort.ts index 6420f8c2e136..e65b73a92250 100644 --- a/packages/datadog-api-client-v1/models/UsageAttributionSort.ts +++ b/packages/datadog-api-client-v1/models/UsageAttributionSort.ts @@ -34,7 +34,9 @@ export type UsageAttributionSort = | typeof ESTIMATED_INDEXED_SPANS_USAGE | typeof ESTIMATED_INDEXED_SPANS_PERCENTAGE | typeof ESTIMATED_INGESTED_SPANS_USAGE - | typeof ESTIMATED_INGESTED_SPANS_PERCENTAGE; + | typeof ESTIMATED_INGESTED_SPANS_PERCENTAGE + | typeof APM_FARGATE_USAGE + | typeof APM_FARGATE_PERCENTAGE; export const API_PERCENTAGE = "api_percentage"; export const SNMP_USAGE = "snmp_usage"; export const APM_HOST_USAGE = "apm_host_usage"; @@ -69,3 +71,5 @@ export const ESTIMATED_INDEXED_SPANS_PERCENTAGE = export const ESTIMATED_INGESTED_SPANS_USAGE = "estimated_ingested_spans_usage"; export const ESTIMATED_INGESTED_SPANS_PERCENTAGE = "estimated_ingested_spans_percentage"; +export const APM_FARGATE_USAGE = "apm_fargate_usage"; +export const APM_FARGATE_PERCENTAGE = "apm_fargate_percentage"; diff --git a/packages/datadog-api-client-v1/models/UsageAttributionSupportedMetrics.ts b/packages/datadog-api-client-v1/models/UsageAttributionSupportedMetrics.ts index e136524dbde2..79fc0dc39fc8 100644 --- a/packages/datadog-api-client-v1/models/UsageAttributionSupportedMetrics.ts +++ b/packages/datadog-api-client-v1/models/UsageAttributionSupportedMetrics.ts @@ -45,6 +45,8 @@ export type UsageAttributionSupportedMetrics = | typeof ESTIMATED_INDEXED_SPANS_PERCENTAGE | typeof ESTIMATED_INGESTED_SPANS_USAGE | typeof ESTIMATED_INGESTED_SPANS_PERCENTAGE + | typeof APM_FARGATE_USAGE + | typeof APM_FARGATE_PERCENTAGE | typeof ALL; export const CUSTOM_TIMESERIES_USAGE = "custom_timeseries_usage"; export const CONTAINER_USAGE = "container_usage"; @@ -90,4 +92,6 @@ export const ESTIMATED_INDEXED_SPANS_PERCENTAGE = export const ESTIMATED_INGESTED_SPANS_USAGE = "estimated_ingested_spans_usage"; export const ESTIMATED_INGESTED_SPANS_PERCENTAGE = "estimated_ingested_spans_percentage"; +export const APM_FARGATE_USAGE = "apm_fargate_usage"; +export const APM_FARGATE_PERCENTAGE = "apm_fargate_percentage"; export const ALL = "*"; diff --git a/packages/datadog-api-client-v1/models/UsageAttributionValues.ts b/packages/datadog-api-client-v1/models/UsageAttributionValues.ts index 2fda3cc22d48..9783eb51b40e 100644 --- a/packages/datadog-api-client-v1/models/UsageAttributionValues.ts +++ b/packages/datadog-api-client-v1/models/UsageAttributionValues.ts @@ -18,6 +18,14 @@ export class UsageAttributionValues { * The synthetic API test usage by tag(s). */ "apiUsage"?: number; + /** + * The percentage of APM ECS Fargate task usage by tag(s). + */ + "apmFargatePercentage"?: number; + /** + * The APM ECS Fargate task usage by tag(s). + */ + "apmFargateUsage"?: number; /** * The percentage of APM host usage by tag(s). */ @@ -214,6 +222,16 @@ export class UsageAttributionValues { type: "number", format: "double", }, + apmFargatePercentage: { + baseName: "apm_fargate_percentage", + type: "number", + format: "double", + }, + apmFargateUsage: { + baseName: "apm_fargate_usage", + type: "number", + format: "double", + }, apmHostPercentage: { baseName: "apm_host_percentage", type: "number", diff --git a/packages/datadog-api-client-v1/models/UsageFargateHour.ts b/packages/datadog-api-client-v1/models/UsageFargateHour.ts index 7605ba91a572..55968a626448 100644 --- a/packages/datadog-api-client-v1/models/UsageFargateHour.ts +++ b/packages/datadog-api-client-v1/models/UsageFargateHour.ts @@ -10,6 +10,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; * Number of Fargate tasks run and hourly usage. */ export class UsageFargateHour { + /** + * The high-water mark of APM ECS Fargate tasks during the given hour. + */ + "apmFargateCount"?: number; /** * The average profiled task count for Fargate Profiling. */ @@ -40,6 +44,11 @@ export class UsageFargateHour { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + apmFargateCount: { + baseName: "apm_fargate_count", + type: "number", + format: "int64", + }, avgProfiledFargateTasks: { baseName: "avg_profiled_fargate_tasks", type: "number", diff --git a/packages/datadog-api-client-v1/models/UsageSummaryDate.ts b/packages/datadog-api-client-v1/models/UsageSummaryDate.ts index 1554c837c513..82d3869c72e9 100644 --- a/packages/datadog-api-client-v1/models/UsageSummaryDate.ts +++ b/packages/datadog-api-client-v1/models/UsageSummaryDate.ts @@ -19,6 +19,10 @@ export class UsageSummaryDate { * Shows the 99th percentile of all Azure app services using APM over all hours in the current date all organizations. */ "apmAzureAppServiceHostTop99p"?: number; + /** + * Shows the average of all APM ECS Fargate tasks over all hours in the current date for all organizations. + */ + "apmFargateCountAvg"?: number; /** * Shows the 99th percentile of all distinct APM hosts over all hours in the current date for all organizations. */ @@ -291,6 +295,11 @@ export class UsageSummaryDate { type: "number", format: "int64", }, + apmFargateCountAvg: { + baseName: "apm_fargate_count_avg", + type: "number", + format: "int64", + }, apmHostTop99p: { baseName: "apm_host_top99p", type: "number", diff --git a/packages/datadog-api-client-v1/models/UsageSummaryDateOrg.ts b/packages/datadog-api-client-v1/models/UsageSummaryDateOrg.ts index 38db49ca987e..912d6dc8ce39 100644 --- a/packages/datadog-api-client-v1/models/UsageSummaryDateOrg.ts +++ b/packages/datadog-api-client-v1/models/UsageSummaryDateOrg.ts @@ -18,6 +18,10 @@ export class UsageSummaryDateOrg { * Shows the 99th percentile of all Azure app services using APM over all hours in the current date for the given org. */ "apmAzureAppServiceHostTop99p"?: number; + /** + * Shows the average of all APM ECS Fargate tasks over all hours in the current months for the given org. + */ + "apmFargateCountAvg"?: number; /** * Shows the 99th percentile of all distinct APM hosts over all hours in the current date for the given org. */ @@ -298,6 +302,11 @@ export class UsageSummaryDateOrg { type: "number", format: "int64", }, + apmFargateCountAvg: { + baseName: "apm_fargate_count_avg", + type: "number", + format: "int64", + }, apmHostTop99p: { baseName: "apm_host_top99p", type: "number", diff --git a/packages/datadog-api-client-v1/models/UsageSummaryResponse.ts b/packages/datadog-api-client-v1/models/UsageSummaryResponse.ts index 74682baf6d50..c38b2181f995 100644 --- a/packages/datadog-api-client-v1/models/UsageSummaryResponse.ts +++ b/packages/datadog-api-client-v1/models/UsageSummaryResponse.ts @@ -20,6 +20,10 @@ export class UsageSummaryResponse { * Shows the 99th percentile of all Azure app services using APM over all hours in the current months all organizations. */ "apmAzureAppServiceHostTop99pSum"?: number; + /** + * Shows the average of all APM ECS Fargate tasks over all hours in the current months for all organizations. + */ + "apmFargateCountAvgSum"?: number; /** * Shows the 99th percentile of all distinct APM hosts over all hours in the current months for all organizations. */ @@ -328,6 +332,11 @@ export class UsageSummaryResponse { type: "number", format: "int64", }, + apmFargateCountAvgSum: { + baseName: "apm_fargate_count_avg_sum", + type: "number", + format: "int64", + }, apmHostTop99pSum: { baseName: "apm_host_top99p_sum", type: "number", From bd612ac9188ae7ffed5a3a5ecb06d194b5ce96ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Wed, 14 Sep 2022 12:13:19 +0200 Subject: [PATCH 14/30] Handle errors in deserialization errors (#836) If the error schema doesn't match, it swallows the server exception which is very unhelpful. Catch potential errors and raise with the original body instead. --- .generator/src/generator/templates/api/api.j2 | 14 +- .../apis/AWSIntegrationApi.ts | 199 ++++- .../apis/AWSLogsIntegrationApi.ts | 155 +++- .../apis/AuthenticationApi.ts | 23 +- .../apis/AzureIntegrationApi.ts | 111 ++- .../apis/DashboardListsApi.ts | 111 ++- .../apis/DashboardsApi.ts | 155 +++- .../apis/DowntimesApi.ts | 155 +++- .../datadog-api-client-v1/apis/EventsApi.ts | 67 +- .../apis/GCPIntegrationApi.ts | 89 +- .../datadog-api-client-v1/apis/HostsApi.ts | 89 +- .../datadog-api-client-v1/apis/IPRangesApi.ts | 23 +- .../apis/KeyManagementApi.ts | 221 +++-- .../datadog-api-client-v1/apis/LogsApi.ts | 90 +- .../apis/LogsIndexesApi.ts | 237 +++-- .../apis/LogsPipelinesApi.ts | 285 ++++-- .../datadog-api-client-v1/apis/MetricsApi.ts | 155 +++- .../datadog-api-client-v1/apis/MonitorsApi.ts | 221 +++-- .../apis/NotebooksApi.ts | 111 ++- .../apis/OrganizationsApi.ts | 133 ++- .../apis/PagerDutyIntegrationApi.ts | 89 +- .../apis/SecurityMonitoringApi.ts | 67 +- .../apis/ServiceChecksApi.ts | 23 +- .../ServiceLevelObjectiveCorrectionsApi.ts | 111 ++- .../apis/ServiceLevelObjectivesApi.ts | 220 +++-- .../apis/SlackIntegrationApi.ts | 111 ++- .../apis/SnapshotsApi.ts | 23 +- .../apis/SyntheticsApi.ts | 595 ++++++++++--- .../datadog-api-client-v1/apis/TagsApi.ts | 111 ++- .../apis/UsageMeteringApi.ts | 837 ++++++++++++++---- .../datadog-api-client-v1/apis/UsersApi.ts | 111 ++- .../apis/WebhooksIntegrationApi.ts | 177 +++- .../datadog-api-client-v2/apis/AuditApi.ts | 45 +- .../apis/AuthNMappingsApi.ts | 111 ++- .../apis/CloudWorkloadSecurityApi.ts | 133 ++- .../apis/DashboardListsApi.ts | 89 +- .../datadog-api-client-v2/apis/EventsApi.ts | 44 +- .../apis/IncidentServicesApi.ts | 110 ++- .../apis/IncidentTeamsApi.ts | 110 ++- .../apis/IncidentsApi.ts | 110 ++- .../apis/KeyManagementApi.ts | 309 +++++-- .../datadog-api-client-v2/apis/LogsApi.ts | 89 +- .../apis/LogsArchivesApi.ts | 221 +++-- .../apis/LogsMetricsApi.ts | 111 ++- .../datadog-api-client-v2/apis/MetricsApi.ts | 265 ++++-- .../apis/OpsgenieIntegrationApi.ts | 111 ++- .../apis/OrganizationsApi.ts | 23 +- .../apis/ProcessesApi.ts | 23 +- packages/datadog-api-client-v2/apis/RUMApi.ts | 177 +++- .../datadog-api-client-v2/apis/RolesApi.ts | 287 ++++-- .../apis/SecurityMonitoringApi.ts | 331 +++++-- .../apis/ServiceAccountsApi.ts | 111 ++- .../apis/UsageMeteringApi.ts | 132 ++- .../datadog-api-client-v2/apis/UsersApi.ts | 221 +++-- 54 files changed, 6400 insertions(+), 1882 deletions(-) diff --git a/.generator/src/generator/templates/api/api.j2 b/.generator/src/generator/templates/api/api.j2 index ec1ef94db7e8..94ecc9810a09 100644 --- a/.generator/src/generator/templates/api/api.j2 +++ b/.generator/src/generator/templates/api/api.j2 @@ -170,6 +170,7 @@ export class {{ className }}ResponseProcessor { {%- endfor -%} ) { {%- if responseType %} + {%- if responseCodes[0].startswith("2") %} {%- if responseSchema and responseSchema.get("format") == "binary" %} const body: {{ responseType }} = await response.getBodyAsFile() as {{ returnType }}; {%- else %} @@ -178,10 +179,19 @@ export class {{ className }}ResponseProcessor { "{{ responseType }}" ) as {{ responseType }}; {%- endif %} - {%- if responseCodes[0].startswith("2") %} return body; {%- else %} - throw new ApiException<{{ responseType }}>(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse(await response.body.text(), contentType); + try { + const body: {{ responseType }} = ObjectSerializer.deserialize( + bodyText, + "{{ responseType }}" + ) as {{ responseType }}; + throw new ApiException<{{ responseType }}>(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException<{{ responseType }}>(response.httpStatusCode, bodyText); + } {%- endif %} {%- else %} {%- if responseCodes[0].startswith("2") %} diff --git a/packages/datadog-api-client-v1/apis/AWSIntegrationApi.ts b/packages/datadog-api-client-v1/apis/AWSIntegrationApi.ts index 73db093664f3..74ca56dbe5ef 100644 --- a/packages/datadog-api-client-v1/apis/AWSIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/AWSIntegrationApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -455,11 +456,23 @@ export class AWSIntegrationApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -502,11 +515,23 @@ export class AWSIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -551,11 +576,23 @@ export class AWSIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -599,11 +636,23 @@ export class AWSIntegrationApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -646,11 +695,23 @@ export class AWSIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -691,11 +752,23 @@ export class AWSIntegrationApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -740,11 +813,23 @@ export class AWSIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -789,11 +874,23 @@ export class AWSIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -837,11 +934,23 @@ export class AWSIntegrationApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/AWSLogsIntegrationApi.ts b/packages/datadog-api-client-v1/apis/AWSLogsIntegrationApi.ts index 93409c565179..c1d2a7d851b2 100644 --- a/packages/datadog-api-client-v1/apis/AWSLogsIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/AWSLogsIntegrationApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -322,11 +323,23 @@ export class AWSLogsIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -371,11 +384,23 @@ export class AWSLogsIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -418,11 +443,23 @@ export class AWSLogsIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -465,11 +502,23 @@ export class AWSLogsIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -512,11 +561,23 @@ export class AWSLogsIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -561,11 +622,23 @@ export class AWSLogsIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -607,11 +680,23 @@ export class AWSLogsIntegrationApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/AuthenticationApi.ts b/packages/datadog-api-client-v1/apis/AuthenticationApi.ts index 32cc72e58630..69bc89e4c261 100644 --- a/packages/datadog-api-client-v1/apis/AuthenticationApi.ts +++ b/packages/datadog-api-client-v1/apis/AuthenticationApi.ts @@ -10,6 +10,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -64,11 +65,23 @@ export class AuthenticationApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/AzureIntegrationApi.ts b/packages/datadog-api-client-v1/apis/AzureIntegrationApi.ts index 189737183760..18c596fc9981 100644 --- a/packages/datadog-api-client-v1/apis/AzureIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/AzureIntegrationApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -246,11 +247,23 @@ export class AzureIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -293,11 +306,23 @@ export class AzureIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -342,11 +367,23 @@ export class AzureIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -389,11 +426,23 @@ export class AzureIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -436,11 +485,23 @@ export class AzureIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/DashboardListsApi.ts b/packages/datadog-api-client-v1/apis/DashboardListsApi.ts index 7bc973df64dc..c666c9b82b08 100644 --- a/packages/datadog-api-client-v1/apis/DashboardListsApi.ts +++ b/packages/datadog-api-client-v1/apis/DashboardListsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -250,11 +251,23 @@ export class DashboardListsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -299,11 +312,23 @@ export class DashboardListsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -348,11 +373,23 @@ export class DashboardListsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -393,11 +430,23 @@ export class DashboardListsApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -443,11 +492,23 @@ export class DashboardListsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/DashboardsApi.ts b/packages/datadog-api-client-v1/apis/DashboardsApi.ts index 1b4b932983a2..e38738f395f0 100644 --- a/packages/datadog-api-client-v1/apis/DashboardsApi.ts +++ b/packages/datadog-api-client-v1/apis/DashboardsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -356,11 +357,23 @@ export class DashboardsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -405,11 +418,23 @@ export class DashboardsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -449,11 +474,23 @@ export class DashboardsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -496,11 +533,23 @@ export class DashboardsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -541,11 +590,23 @@ export class DashboardsApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -585,11 +646,23 @@ export class DashboardsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -633,11 +706,23 @@ export class DashboardsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/DowntimesApi.ts b/packages/datadog-api-client-v1/apis/DowntimesApi.ts index 5291d689da2b..7360a8d76157 100644 --- a/packages/datadog-api-client-v1/apis/DowntimesApi.ts +++ b/packages/datadog-api-client-v1/apis/DowntimesApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -335,11 +336,23 @@ export class DowntimesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -385,11 +398,23 @@ export class DowntimesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -432,11 +457,23 @@ export class DowntimesApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -479,11 +516,23 @@ export class DowntimesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -524,11 +573,23 @@ export class DowntimesApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -573,11 +634,23 @@ export class DowntimesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -621,11 +694,23 @@ export class DowntimesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/EventsApi.ts b/packages/datadog-api-client-v1/apis/EventsApi.ts index cc9773580a65..831c18d6ba4f 100644 --- a/packages/datadog-api-client-v1/apis/EventsApi.ts +++ b/packages/datadog-api-client-v1/apis/EventsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -223,11 +224,23 @@ export class EventsApiResponseProcessor { return body; } if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -270,11 +283,23 @@ export class EventsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -319,11 +344,23 @@ export class EventsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/GCPIntegrationApi.ts b/packages/datadog-api-client-v1/apis/GCPIntegrationApi.ts index 8a386436d674..9d959c251441 100644 --- a/packages/datadog-api-client-v1/apis/GCPIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/GCPIntegrationApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -202,11 +203,23 @@ export class GCPIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -249,11 +262,23 @@ export class GCPIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -298,11 +323,23 @@ export class GCPIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -345,11 +382,23 @@ export class GCPIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/HostsApi.ts b/packages/datadog-api-client-v1/apis/HostsApi.ts index f327a58a428d..29de121a2fee 100644 --- a/packages/datadog-api-client-v1/apis/HostsApi.ts +++ b/packages/datadog-api-client-v1/apis/HostsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -258,11 +259,23 @@ export class HostsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -305,11 +318,23 @@ export class HostsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -352,11 +377,23 @@ export class HostsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -401,11 +438,23 @@ export class HostsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/IPRangesApi.ts b/packages/datadog-api-client-v1/apis/IPRangesApi.ts index bcfd14384a0d..4c2c24b410e1 100644 --- a/packages/datadog-api-client-v1/apis/IPRangesApi.ts +++ b/packages/datadog-api-client-v1/apis/IPRangesApi.ts @@ -9,6 +9,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -54,11 +55,23 @@ export class IPRangesApiResponseProcessor { return body; } if (response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/KeyManagementApi.ts b/packages/datadog-api-client-v1/apis/KeyManagementApi.ts index d61bdb13a0ef..d0f3e4061e46 100644 --- a/packages/datadog-api-client-v1/apis/KeyManagementApi.ts +++ b/packages/datadog-api-client-v1/apis/KeyManagementApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -442,11 +443,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -492,11 +505,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -542,11 +567,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -591,11 +628,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -638,11 +687,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -687,11 +748,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -732,11 +805,23 @@ export class KeyManagementApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -777,11 +862,23 @@ export class KeyManagementApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -827,11 +924,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -878,11 +987,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/LogsApi.ts b/packages/datadog-api-client-v1/apis/LogsApi.ts index f5b03c2b901c..c4304b322c9f 100644 --- a/packages/datadog-api-client-v1/apis/LogsApi.ts +++ b/packages/datadog-api-client-v1/apis/LogsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -152,21 +153,45 @@ export class LogsApiResponseProcessor { return body; } if (response.httpStatusCode == 400) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse" - ) as LogsAPIErrorResponse; - throw new ApiException( - response.httpStatusCode, - body + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType ); + try { + const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "LogsAPIErrorResponse" + ) as LogsAPIErrorResponse; + throw new ApiException( + response.httpStatusCode, + body + ); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -205,18 +230,39 @@ export class LogsApiResponseProcessor { return body; } if (response.httpStatusCode == 400) { - const body: HTTPLogError = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "HTTPLogError" - ) as HTTPLogError; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: HTTPLogError = ObjectSerializer.deserialize( + bodyText, + "HTTPLogError" + ) as HTTPLogError; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException(response.httpStatusCode, bodyText); + } } if (response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts b/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts index 37d6c90f2404..1386a91088b9 100644 --- a/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts +++ b/packages/datadog-api-client-v1/apis/LogsIndexesApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -276,21 +277,45 @@ export class LogsIndexesApiResponseProcessor { return body; } if (response.httpStatusCode == 400) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse" - ) as LogsAPIErrorResponse; - throw new ApiException( - response.httpStatusCode, - body + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType ); + try { + const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "LogsAPIErrorResponse" + ) as LogsAPIErrorResponse; + throw new ApiException( + response.httpStatusCode, + body + ); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -329,21 +354,45 @@ export class LogsIndexesApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } if (response.httpStatusCode == 404) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse" - ) as LogsAPIErrorResponse; - throw new ApiException( - response.httpStatusCode, - body + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType ); + try { + const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "LogsAPIErrorResponse" + ) as LogsAPIErrorResponse; + throw new ApiException( + response.httpStatusCode, + body + ); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -384,11 +433,23 @@ export class LogsIndexesApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -429,11 +490,23 @@ export class LogsIndexesApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -472,21 +545,45 @@ export class LogsIndexesApiResponseProcessor { return body; } if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse" - ) as LogsAPIErrorResponse; - throw new ApiException( - response.httpStatusCode, - body + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType ); + try { + const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "LogsAPIErrorResponse" + ) as LogsAPIErrorResponse; + throw new ApiException( + response.httpStatusCode, + body + ); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } if (response.httpStatusCode == 403) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -527,21 +624,45 @@ export class LogsIndexesApiResponseProcessor { return body; } if (response.httpStatusCode == 400) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse" - ) as LogsAPIErrorResponse; - throw new ApiException( - response.httpStatusCode, - body + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType ); + try { + const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "LogsAPIErrorResponse" + ) as LogsAPIErrorResponse; + throw new ApiException( + response.httpStatusCode, + body + ); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/LogsPipelinesApi.ts b/packages/datadog-api-client-v1/apis/LogsPipelinesApi.ts index 35ca884ebacb..8d01abcb9c8d 100644 --- a/packages/datadog-api-client-v1/apis/LogsPipelinesApi.ts +++ b/packages/datadog-api-client-v1/apis/LogsPipelinesApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -313,21 +314,45 @@ export class LogsPipelinesApiResponseProcessor { return body; } if (response.httpStatusCode == 400) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse" - ) as LogsAPIErrorResponse; - throw new ApiException( - response.httpStatusCode, - body + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType ); + try { + const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "LogsAPIErrorResponse" + ) as LogsAPIErrorResponse; + throw new ApiException( + response.httpStatusCode, + body + ); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -362,21 +387,45 @@ export class LogsPipelinesApiResponseProcessor { return; } if (response.httpStatusCode == 400) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse" - ) as LogsAPIErrorResponse; - throw new ApiException( - response.httpStatusCode, - body + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType ); + try { + const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "LogsAPIErrorResponse" + ) as LogsAPIErrorResponse; + throw new ApiException( + response.httpStatusCode, + body + ); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -417,21 +466,45 @@ export class LogsPipelinesApiResponseProcessor { return body; } if (response.httpStatusCode == 400) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse" - ) as LogsAPIErrorResponse; - throw new ApiException( - response.httpStatusCode, - body + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType ); + try { + const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "LogsAPIErrorResponse" + ) as LogsAPIErrorResponse; + throw new ApiException( + response.httpStatusCode, + body + ); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -472,11 +545,23 @@ export class LogsPipelinesApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -517,11 +602,23 @@ export class LogsPipelinesApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -562,21 +659,45 @@ export class LogsPipelinesApiResponseProcessor { return body; } if (response.httpStatusCode == 400) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse" - ) as LogsAPIErrorResponse; - throw new ApiException( - response.httpStatusCode, - body + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType ); + try { + const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "LogsAPIErrorResponse" + ) as LogsAPIErrorResponse; + throw new ApiException( + response.httpStatusCode, + body + ); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -617,21 +738,45 @@ export class LogsPipelinesApiResponseProcessor { return body; } if (response.httpStatusCode == 400 || response.httpStatusCode == 422) { - const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "LogsAPIErrorResponse" - ) as LogsAPIErrorResponse; - throw new ApiException( - response.httpStatusCode, - body + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType ); + try { + const body: LogsAPIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "LogsAPIErrorResponse" + ) as LogsAPIErrorResponse; + throw new ApiException( + response.httpStatusCode, + body + ); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/MetricsApi.ts b/packages/datadog-api-client-v1/apis/MetricsApi.ts index 4dc99f2e80b7..c780146df89c 100644 --- a/packages/datadog-api-client-v1/apis/MetricsApi.ts +++ b/packages/datadog-api-client-v1/apis/MetricsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -415,11 +416,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -464,11 +477,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -513,11 +538,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -562,11 +599,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -613,11 +662,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 413 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -664,11 +725,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 413 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -714,11 +787,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/MonitorsApi.ts b/packages/datadog-api-client-v1/apis/MonitorsApi.ts index 7b49adbbd94f..f6cf09c30653 100644 --- a/packages/datadog-api-client-v1/apis/MonitorsApi.ts +++ b/packages/datadog-api-client-v1/apis/MonitorsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -584,11 +585,23 @@ export class MonitorsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -631,11 +644,23 @@ export class MonitorsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -682,11 +707,23 @@ export class MonitorsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -730,11 +767,23 @@ export class MonitorsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -779,11 +828,23 @@ export class MonitorsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -828,11 +889,23 @@ export class MonitorsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -877,11 +950,23 @@ export class MonitorsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -926,11 +1011,23 @@ export class MonitorsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -975,11 +1072,23 @@ export class MonitorsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1022,11 +1131,23 @@ export class MonitorsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/NotebooksApi.ts b/packages/datadog-api-client-v1/apis/NotebooksApi.ts index f2ee46e01e5e..de396ea55bb3 100644 --- a/packages/datadog-api-client-v1/apis/NotebooksApi.ts +++ b/packages/datadog-api-client-v1/apis/NotebooksApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -318,11 +319,23 @@ export class NotebooksApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -362,11 +375,23 @@ export class NotebooksApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -412,11 +437,23 @@ export class NotebooksApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -461,11 +498,23 @@ export class NotebooksApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -512,11 +561,23 @@ export class NotebooksApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/OrganizationsApi.ts b/packages/datadog-api-client-v1/apis/OrganizationsApi.ts index 94601cc11a0f..101d95214271 100644 --- a/packages/datadog-api-client-v1/apis/OrganizationsApi.ts +++ b/packages/datadog-api-client-v1/apis/OrganizationsApi.ts @@ -16,6 +16,7 @@ import { import FormData from "form-data"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -302,11 +303,23 @@ export class OrganizationsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -351,11 +364,23 @@ export class OrganizationsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -400,11 +425,23 @@ export class OrganizationsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -445,11 +482,23 @@ export class OrganizationsApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -494,11 +543,23 @@ export class OrganizationsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -544,11 +605,23 @@ export class OrganizationsApiResponseProcessor { response.httpStatusCode == 415 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/PagerDutyIntegrationApi.ts b/packages/datadog-api-client-v1/apis/PagerDutyIntegrationApi.ts index 4fa8b78fbd36..b7287cea6466 100644 --- a/packages/datadog-api-client-v1/apis/PagerDutyIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/PagerDutyIntegrationApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -223,11 +224,23 @@ export class PagerDutyIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -268,11 +281,23 @@ export class PagerDutyIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -317,11 +342,23 @@ export class PagerDutyIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -363,11 +400,23 @@ export class PagerDutyIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/SecurityMonitoringApi.ts b/packages/datadog-api-client-v1/apis/SecurityMonitoringApi.ts index fb7383916ea9..078f39c80ea3 100644 --- a/packages/datadog-api-client-v1/apis/SecurityMonitoringApi.ts +++ b/packages/datadog-api-client-v1/apis/SecurityMonitoringApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -219,11 +220,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -269,11 +282,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -319,11 +344,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/ServiceChecksApi.ts b/packages/datadog-api-client-v1/apis/ServiceChecksApi.ts index ea7d0c908497..51ae94fdd620 100644 --- a/packages/datadog-api-client-v1/apis/ServiceChecksApi.ts +++ b/packages/datadog-api-client-v1/apis/ServiceChecksApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -91,11 +92,23 @@ export class ServiceChecksApiResponseProcessor { response.httpStatusCode == 413 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/ServiceLevelObjectiveCorrectionsApi.ts b/packages/datadog-api-client-v1/apis/ServiceLevelObjectiveCorrectionsApi.ts index dd61e3bbf785..1dbc6581f894 100644 --- a/packages/datadog-api-client-v1/apis/ServiceLevelObjectiveCorrectionsApi.ts +++ b/packages/datadog-api-client-v1/apis/ServiceLevelObjectiveCorrectionsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -247,11 +248,23 @@ export class ServiceLevelObjectiveCorrectionsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -290,11 +303,23 @@ export class ServiceLevelObjectiveCorrectionsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -339,11 +364,23 @@ export class ServiceLevelObjectiveCorrectionsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -384,11 +421,23 @@ export class ServiceLevelObjectiveCorrectionsApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -434,11 +483,23 @@ export class ServiceLevelObjectiveCorrectionsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts b/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts index 38c13c3c71fd..32a88c55ef2b 100644 --- a/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts +++ b/packages/datadog-api-client-v1/apis/ServiceLevelObjectivesApi.ts @@ -586,11 +586,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -633,11 +645,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -682,11 +706,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -731,11 +767,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -778,11 +826,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -828,11 +888,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -878,11 +950,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -926,11 +1010,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -975,11 +1071,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1023,11 +1131,23 @@ export class ServiceLevelObjectivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/SlackIntegrationApi.ts b/packages/datadog-api-client-v1/apis/SlackIntegrationApi.ts index efae339a37a5..cad8a09fbf38 100644 --- a/packages/datadog-api-client-v1/apis/SlackIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/SlackIntegrationApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -310,11 +311,23 @@ export class SlackIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -360,11 +373,23 @@ export class SlackIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -410,11 +435,23 @@ export class SlackIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -456,11 +493,23 @@ export class SlackIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -506,11 +555,23 @@ export class SlackIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/SnapshotsApi.ts b/packages/datadog-api-client-v1/apis/SnapshotsApi.ts index 0da04bede4f4..591b922147c4 100644 --- a/packages/datadog-api-client-v1/apis/SnapshotsApi.ts +++ b/packages/datadog-api-client-v1/apis/SnapshotsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -145,11 +146,23 @@ export class SnapshotsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/SyntheticsApi.ts b/packages/datadog-api-client-v1/apis/SyntheticsApi.ts index 1f41b185030d..0936e9f73488 100644 --- a/packages/datadog-api-client-v1/apis/SyntheticsApi.ts +++ b/packages/datadog-api-client-v1/apis/SyntheticsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -1251,11 +1252,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1301,11 +1314,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1352,11 +1377,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1402,11 +1439,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1446,11 +1495,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1485,11 +1546,23 @@ export class SyntheticsApiResponseProcessor { return; } if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1535,11 +1608,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1584,11 +1669,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1633,11 +1730,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1683,11 +1792,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1733,11 +1854,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1782,11 +1915,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1832,11 +1977,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1883,11 +2040,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1933,11 +2102,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1978,11 +2159,23 @@ export class SyntheticsApiResponseProcessor { return body; } if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2023,11 +2216,23 @@ export class SyntheticsApiResponseProcessor { return body; } if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2072,11 +2277,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2118,11 +2335,23 @@ export class SyntheticsApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2164,11 +2393,23 @@ export class SyntheticsApiResponseProcessor { return body; } if (response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2213,11 +2454,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2259,11 +2512,23 @@ export class SyntheticsApiResponseProcessor { return body; } if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2306,11 +2571,23 @@ export class SyntheticsApiResponseProcessor { return body; } if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2357,11 +2634,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2407,11 +2696,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2452,11 +2753,23 @@ export class SyntheticsApiResponseProcessor { return body; } if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2502,11 +2815,23 @@ export class SyntheticsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/TagsApi.ts b/packages/datadog-api-client-v1/apis/TagsApi.ts index 18b3a419325d..fbf7defdf7ca 100644 --- a/packages/datadog-api-client-v1/apis/TagsApi.ts +++ b/packages/datadog-api-client-v1/apis/TagsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -299,11 +300,23 @@ export class TagsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -342,11 +355,23 @@ export class TagsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -389,11 +414,23 @@ export class TagsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -436,11 +473,23 @@ export class TagsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -483,11 +532,23 @@ export class TagsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts b/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts index f9f82de565d2..21f48d6050d6 100644 --- a/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts +++ b/packages/datadog-api-client-v1/apis/UsageMeteringApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -2220,11 +2221,23 @@ export class UsageMeteringApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2265,11 +2278,23 @@ export class UsageMeteringApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2315,11 +2340,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2365,11 +2402,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2410,11 +2459,23 @@ export class UsageMeteringApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2456,11 +2517,23 @@ export class UsageMeteringApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2507,11 +2580,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2559,11 +2644,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2609,11 +2706,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2654,11 +2763,23 @@ export class UsageMeteringApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2703,11 +2824,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2752,11 +2885,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2801,11 +2946,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2851,11 +3008,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2901,11 +3070,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2950,11 +3131,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -2999,11 +3192,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3048,11 +3253,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3097,11 +3314,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3146,11 +3375,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3195,11 +3436,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3244,11 +3497,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3293,11 +3558,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3342,11 +3619,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3391,11 +3680,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3440,11 +3741,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3489,11 +3802,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3538,11 +3863,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3587,11 +3924,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3636,11 +3985,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3685,11 +4046,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3734,11 +4107,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3783,11 +4168,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3832,11 +4229,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3881,11 +4290,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3930,11 +4351,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -3979,11 +4412,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -4028,11 +4473,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/UsersApi.ts b/packages/datadog-api-client-v1/apis/UsersApi.ts index 089ddc14c2dd..ffde4a36aac9 100644 --- a/packages/datadog-api-client-v1/apis/UsersApi.ts +++ b/packages/datadog-api-client-v1/apis/UsersApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -245,11 +246,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -295,11 +308,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -342,11 +367,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -385,11 +422,23 @@ export class UsersApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -433,11 +482,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v1/apis/WebhooksIntegrationApi.ts b/packages/datadog-api-client-v1/apis/WebhooksIntegrationApi.ts index e8339a1eeffb..ca232b0b8937 100644 --- a/packages/datadog-api-client-v1/apis/WebhooksIntegrationApi.ts +++ b/packages/datadog-api-client-v1/apis/WebhooksIntegrationApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -404,11 +405,23 @@ export class WebhooksIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -454,11 +467,23 @@ export class WebhooksIntegrationApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -500,11 +525,23 @@ export class WebhooksIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -545,11 +582,23 @@ export class WebhooksIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -595,11 +644,23 @@ export class WebhooksIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -646,11 +707,23 @@ export class WebhooksIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -697,11 +770,23 @@ export class WebhooksIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -748,11 +833,23 @@ export class WebhooksIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/AuditApi.ts b/packages/datadog-api-client-v2/apis/AuditApi.ts index 5fa8c075a31e..65a36ee0b2b8 100644 --- a/packages/datadog-api-client-v2/apis/AuditApi.ts +++ b/packages/datadog-api-client-v2/apis/AuditApi.ts @@ -10,6 +10,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -154,11 +155,23 @@ export class AuditApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -203,11 +216,23 @@ export class AuditApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/AuthNMappingsApi.ts b/packages/datadog-api-client-v2/apis/AuthNMappingsApi.ts index bc041217b29c..da50cc222db6 100644 --- a/packages/datadog-api-client-v2/apis/AuthNMappingsApi.ts +++ b/packages/datadog-api-client-v2/apis/AuthNMappingsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -283,11 +284,23 @@ export class AuthNMappingsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -326,11 +339,23 @@ export class AuthNMappingsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -375,11 +400,23 @@ export class AuthNMappingsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -420,11 +457,23 @@ export class AuthNMappingsApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -472,11 +521,23 @@ export class AuthNMappingsApiResponseProcessor { response.httpStatusCode == 422 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/CloudWorkloadSecurityApi.ts b/packages/datadog-api-client-v2/apis/CloudWorkloadSecurityApi.ts index 5aec938895d6..31dfb5f5e6fe 100644 --- a/packages/datadog-api-client-v2/apis/CloudWorkloadSecurityApi.ts +++ b/packages/datadog-api-client-v2/apis/CloudWorkloadSecurityApi.ts @@ -14,6 +14,7 @@ import { HttpFile, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -290,11 +291,23 @@ export class CloudWorkloadSecurityApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -336,11 +349,23 @@ export class CloudWorkloadSecurityApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -378,11 +403,23 @@ export class CloudWorkloadSecurityApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -425,11 +462,23 @@ export class CloudWorkloadSecurityApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -472,11 +521,23 @@ export class CloudWorkloadSecurityApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -525,11 +586,23 @@ export class CloudWorkloadSecurityApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/DashboardListsApi.ts b/packages/datadog-api-client-v2/apis/DashboardListsApi.ts index c9e53fbd816a..ef976c41c10e 100644 --- a/packages/datadog-api-client-v2/apis/DashboardListsApi.ts +++ b/packages/datadog-api-client-v2/apis/DashboardListsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -260,11 +261,23 @@ export class DashboardListsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -311,11 +324,23 @@ export class DashboardListsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -361,11 +386,23 @@ export class DashboardListsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -412,11 +449,23 @@ export class DashboardListsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/EventsApi.ts b/packages/datadog-api-client-v2/apis/EventsApi.ts index 8b3b98dbc526..536596168758 100644 --- a/packages/datadog-api-client-v2/apis/EventsApi.ts +++ b/packages/datadog-api-client-v2/apis/EventsApi.ts @@ -167,11 +167,23 @@ export class EventsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -216,11 +228,23 @@ export class EventsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/IncidentServicesApi.ts b/packages/datadog-api-client-v2/apis/IncidentServicesApi.ts index 00ecc57cd490..23af3a4399ce 100644 --- a/packages/datadog-api-client-v2/apis/IncidentServicesApi.ts +++ b/packages/datadog-api-client-v2/apis/IncidentServicesApi.ts @@ -319,11 +319,23 @@ export class IncidentServicesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -364,11 +376,23 @@ export class IncidentServicesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -415,11 +439,23 @@ export class IncidentServicesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -466,11 +502,23 @@ export class IncidentServicesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -517,11 +565,23 @@ export class IncidentServicesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/IncidentTeamsApi.ts b/packages/datadog-api-client-v2/apis/IncidentTeamsApi.ts index 9318b162f998..5c048bfa8753 100644 --- a/packages/datadog-api-client-v2/apis/IncidentTeamsApi.ts +++ b/packages/datadog-api-client-v2/apis/IncidentTeamsApi.ts @@ -319,11 +319,23 @@ export class IncidentTeamsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -364,11 +376,23 @@ export class IncidentTeamsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -415,11 +439,23 @@ export class IncidentTeamsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -466,11 +502,23 @@ export class IncidentTeamsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -517,11 +565,23 @@ export class IncidentTeamsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/IncidentsApi.ts b/packages/datadog-api-client-v2/apis/IncidentsApi.ts index a88122e467cc..f1ee421011ab 100644 --- a/packages/datadog-api-client-v2/apis/IncidentsApi.ts +++ b/packages/datadog-api-client-v2/apis/IncidentsApi.ts @@ -322,11 +322,23 @@ export class IncidentsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -367,11 +379,23 @@ export class IncidentsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -418,11 +442,23 @@ export class IncidentsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -469,11 +505,23 @@ export class IncidentsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -520,11 +568,23 @@ export class IncidentsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/KeyManagementApi.ts b/packages/datadog-api-client-v2/apis/KeyManagementApi.ts index 2fb4fc5d7c0c..8b567a9bc37e 100644 --- a/packages/datadog-api-client-v2/apis/KeyManagementApi.ts +++ b/packages/datadog-api-client-v2/apis/KeyManagementApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -774,11 +775,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -823,11 +836,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -866,11 +891,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -909,11 +946,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -954,11 +1003,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1001,11 +1062,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1051,11 +1124,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1100,11 +1185,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1149,11 +1246,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1199,11 +1308,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1249,11 +1370,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1299,11 +1432,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1349,11 +1494,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1399,11 +1556,23 @@ export class KeyManagementApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/LogsApi.ts b/packages/datadog-api-client-v2/apis/LogsApi.ts index 20b227a7760b..d1dd91958673 100644 --- a/packages/datadog-api-client-v2/apis/LogsApi.ts +++ b/packages/datadog-api-client-v2/apis/LogsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -274,11 +275,23 @@ export class LogsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -321,11 +334,23 @@ export class LogsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -370,11 +395,23 @@ export class LogsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -422,11 +459,23 @@ export class LogsApiResponseProcessor { response.httpStatusCode == 500 || response.httpStatusCode == 503 ) { - const body: HTTPLogErrors = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "HTTPLogErrors" - ) as HTTPLogErrors; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: HTTPLogErrors = ObjectSerializer.deserialize( + bodyText, + "HTTPLogErrors" + ) as HTTPLogErrors; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/LogsArchivesApi.ts b/packages/datadog-api-client-v2/apis/LogsArchivesApi.ts index f095da14703a..6520e0a5cafa 100644 --- a/packages/datadog-api-client-v2/apis/LogsArchivesApi.ts +++ b/packages/datadog-api-client-v2/apis/LogsArchivesApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -465,11 +466,23 @@ export class LogsArchivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -514,11 +527,23 @@ export class LogsArchivesApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -558,11 +583,23 @@ export class LogsArchivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -606,11 +643,23 @@ export class LogsArchivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -651,11 +700,23 @@ export class LogsArchivesApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -701,11 +762,23 @@ export class LogsArchivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -746,11 +819,23 @@ export class LogsArchivesApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -790,11 +875,23 @@ export class LogsArchivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -840,11 +937,23 @@ export class LogsArchivesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -890,11 +999,23 @@ export class LogsArchivesApiResponseProcessor { response.httpStatusCode == 422 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/LogsMetricsApi.ts b/packages/datadog-api-client-v2/apis/LogsMetricsApi.ts index 2b8d85f18cdf..ddb5f7123fdf 100644 --- a/packages/datadog-api-client-v2/apis/LogsMetricsApi.ts +++ b/packages/datadog-api-client-v2/apis/LogsMetricsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -249,11 +250,23 @@ export class LogsMetricsApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -292,11 +305,23 @@ export class LogsMetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -341,11 +366,23 @@ export class LogsMetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -386,11 +423,23 @@ export class LogsMetricsApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -436,11 +485,23 @@ export class LogsMetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/MetricsApi.ts b/packages/datadog-api-client-v2/apis/MetricsApi.ts index 67937734398d..5a494e3f2fb0 100644 --- a/packages/datadog-api-client-v2/apis/MetricsApi.ts +++ b/packages/datadog-api-client-v2/apis/MetricsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -667,11 +668,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -717,11 +730,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -767,11 +792,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -812,11 +849,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -862,11 +911,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -913,11 +974,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -963,11 +1036,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1013,11 +1098,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1064,11 +1161,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1114,11 +1223,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1165,11 +1286,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 413 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1215,11 +1348,23 @@ export class MetricsApiResponseProcessor { response.httpStatusCode == 422 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/OpsgenieIntegrationApi.ts b/packages/datadog-api-client-v2/apis/OpsgenieIntegrationApi.ts index 6516497e56fc..c92820d9afd2 100644 --- a/packages/datadog-api-client-v2/apis/OpsgenieIntegrationApi.ts +++ b/packages/datadog-api-client-v2/apis/OpsgenieIntegrationApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -250,11 +251,23 @@ export class OpsgenieIntegrationApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -294,11 +307,23 @@ export class OpsgenieIntegrationApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -345,11 +370,23 @@ export class OpsgenieIntegrationApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -390,11 +427,23 @@ export class OpsgenieIntegrationApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -441,11 +490,23 @@ export class OpsgenieIntegrationApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/OrganizationsApi.ts b/packages/datadog-api-client-v2/apis/OrganizationsApi.ts index 703a91f2fd42..fcf0affcd841 100644 --- a/packages/datadog-api-client-v2/apis/OrganizationsApi.ts +++ b/packages/datadog-api-client-v2/apis/OrganizationsApi.ts @@ -13,6 +13,7 @@ import { import FormData from "form-data"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -74,11 +75,23 @@ export class OrganizationsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/ProcessesApi.ts b/packages/datadog-api-client-v2/apis/ProcessesApi.ts index 34f9d205d9c8..a1bfadeb34e2 100644 --- a/packages/datadog-api-client-v2/apis/ProcessesApi.ts +++ b/packages/datadog-api-client-v2/apis/ProcessesApi.ts @@ -10,6 +10,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -115,11 +116,23 @@ export class ProcessesApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/RUMApi.ts b/packages/datadog-api-client-v2/apis/RUMApi.ts index 866430c54a81..eade144ef174 100644 --- a/packages/datadog-api-client-v2/apis/RUMApi.ts +++ b/packages/datadog-api-client-v2/apis/RUMApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -413,11 +414,23 @@ export class RUMApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -458,11 +471,23 @@ export class RUMApiResponseProcessor { return body; } if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -497,11 +522,23 @@ export class RUMApiResponseProcessor { return; } if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -542,11 +579,23 @@ export class RUMApiResponseProcessor { return body; } if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -587,11 +636,23 @@ export class RUMApiResponseProcessor { return body; } if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -636,11 +697,23 @@ export class RUMApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -685,11 +758,23 @@ export class RUMApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -735,11 +820,23 @@ export class RUMApiResponseProcessor { response.httpStatusCode == 422 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/RolesApi.ts b/packages/datadog-api-client-v2/apis/RolesApi.ts index 3a3b82003dfa..24b3da970744 100644 --- a/packages/datadog-api-client-v2/apis/RolesApi.ts +++ b/packages/datadog-api-client-v2/apis/RolesApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -700,11 +701,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -750,11 +763,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -799,11 +824,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -848,11 +885,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -891,11 +940,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -938,11 +999,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -987,11 +1060,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1036,11 +1121,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1079,11 +1176,23 @@ export class RolesApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1128,11 +1237,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1178,11 +1299,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1228,11 +1361,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1279,11 +1424,23 @@ export class RolesApiResponseProcessor { response.httpStatusCode == 422 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts index f04c5bc68be5..af181d80f4dc 100644 --- a/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts +++ b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -787,11 +788,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -836,11 +849,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -879,11 +904,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -924,11 +961,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -975,11 +1024,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1027,11 +1088,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1079,11 +1152,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1129,11 +1214,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1174,11 +1271,23 @@ export class SecurityMonitoringApiResponseProcessor { return body; } if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1219,11 +1328,23 @@ export class SecurityMonitoringApiResponseProcessor { return body; } if (response.httpStatusCode == 403 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1265,11 +1386,23 @@ export class SecurityMonitoringApiResponseProcessor { return body; } if (response.httpStatusCode == 400 || response.httpStatusCode == 429) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1316,11 +1449,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1367,11 +1512,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1419,11 +1576,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 409 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -1470,11 +1639,23 @@ export class SecurityMonitoringApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/ServiceAccountsApi.ts b/packages/datadog-api-client-v2/apis/ServiceAccountsApi.ts index d3771eab9a1f..e853a4a9aed7 100644 --- a/packages/datadog-api-client-v2/apis/ServiceAccountsApi.ts +++ b/packages/datadog-api-client-v2/apis/ServiceAccountsApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -358,11 +359,23 @@ export class ServiceAccountsApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -403,11 +416,23 @@ export class ServiceAccountsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -452,11 +477,23 @@ export class ServiceAccountsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -502,11 +539,23 @@ export class ServiceAccountsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -552,11 +601,23 @@ export class ServiceAccountsApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts b/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts index 2c5d16d5678e..7560d3919a5f 100644 --- a/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts +++ b/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts @@ -432,11 +432,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -481,11 +493,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -530,11 +554,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -580,11 +616,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -631,11 +679,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -682,11 +742,23 @@ export class UsageMeteringApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml diff --git a/packages/datadog-api-client-v2/apis/UsersApi.ts b/packages/datadog-api-client-v2/apis/UsersApi.ts index 95f6d99c6c96..7ebeb22c7633 100644 --- a/packages/datadog-api-client-v2/apis/UsersApi.ts +++ b/packages/datadog-api-client-v2/apis/UsersApi.ts @@ -13,6 +13,7 @@ import { ResponseContext, } from "../../datadog-api-client-common/http/http"; +import { logger } from "../../../logger"; import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; @@ -502,11 +503,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -549,11 +562,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -592,11 +617,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -641,11 +678,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -688,11 +737,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -737,11 +798,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -786,11 +859,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 404 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -833,11 +918,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -882,11 +979,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 403 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml @@ -931,11 +1040,23 @@ export class UsersApiResponseProcessor { response.httpStatusCode == 422 || response.httpStatusCode == 429 ) { - const body: APIErrorResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "APIErrorResponse" - ) as APIErrorResponse; - throw new ApiException(response.httpStatusCode, body); + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } } // Work around for missing responses in specification, e.g. for petstore.yaml From 39c25065a8d816b5250ccfd5be474f62b70a802c Mon Sep 17 00:00:00 2001 From: skarimo <40482491+skarimo@users.noreply.github.com> Date: Fri, 16 Sep 2022 15:15:27 -0400 Subject: [PATCH 15/30] add readme for proxy usage (#844) --- README.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/README.md b/README.md index f95a619d32b0..07f057ec9985 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,78 @@ async function main() { main(); ``` +### Configure proxy + +You can provide custom `HttpLibrary` implementation with proxy support to `configuration` object. See example below: + +```typescript +import pako from "pako"; +import bufferFrom from "buffer-from"; +import fetch from "node-fetch"; +import { HttpsProxyAgent } from "https-proxy-agent"; +import { v1, client } from "@datadog/datadog-api-client"; + +const proxyAgent = new HttpsProxyAgent('http://127.0.0.11:3128'); + +class HttpLibraryWithProxy implements client.HttpLibrary { + public debug = false; + + public send(request: client.RequestContext): Promise { + const method = request.getHttpMethod().toString(); + let body = request.getBody(); + + let compress = request.getHttpConfig().compress; + if (compress === undefined) { + compress = true; + } + + const headers = request.getHeaders(); + if (typeof body === "string") { + if (headers["Content-Encoding"] == "gzip") { + body = bufferFrom(pako.gzip(body).buffer); + } else if (headers["Content-Encoding"] == "deflate") { + body = bufferFrom(pako.deflate(body).buffer); + } + } + + const resultPromise = fetch(request.getUrl(), { + method: method, + body: body as any, + headers: headers, + signal: request.getHttpConfig().signal, + compress: compress, + agent: proxyAgent, + }).then((resp: any) => { + const headers: { [name: string]: string } = {}; + resp.headers.forEach((value: string, name: string) => { + headers[name] = value; + }); + + const body = { + text: () => resp.text(), + binary: () => resp.buffer(), + }; + const response = new client.ResponseContext(resp.status, headers, body); + return response; + }); + + return resultPromise; + } +} + +const configuration = client.createConfiguration({httpApi: new HttpLibraryWithProxy()}); +const apiInstance = new v1.DashboardsApi(configuration); + +apiInstance + .listDashboards() + .then((data: v1.DashboardSummary) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); +``` + ## Documentation Documentation for API endpoints can be found in [GitHub pages][github pages]. From 56d9a4ff9a1bf78f8bc03136adcc9544fb9d9d89 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 10:12:58 +0200 Subject: [PATCH 16/30] Bump mako from 1.2.0 to 1.2.2 in /.generator (#845) Bumps [mako](https://github.com/sqlalchemy/mako) from 1.2.0 to 1.2.2. - [Release notes](https://github.com/sqlalchemy/mako/releases) - [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES) - [Commits](https://github.com/sqlalchemy/mako/commits) --- updated-dependencies: - dependency-name: mako dependency-type: indirect ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .generator/poetry.lock | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/.generator/poetry.lock b/.generator/poetry.lock index c2f90934b0f6..31254f1fbe15 100644 --- a/.generator/poetry.lock +++ b/.generator/poetry.lock @@ -15,10 +15,10 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [package.extras] -dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit", "cloudpickle"] -docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] -tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "cloudpickle"] -tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "cloudpickle"] +dev = ["cloudpickle", "coverage[toml] (>=5.0.2)", "furo", "hypothesis", "mypy", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "six", "sphinx", "sphinx-notfound-page", "zope.interface"] +docs = ["furo", "sphinx", "sphinx-notfound-page", "zope.interface"] +tests = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "six", "zope.interface"] +tests_no_zope = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "six"] [[package]] name = "click" @@ -78,8 +78,8 @@ optional = false python-versions = "*" [[package]] -name = "mako" -version = "1.2.0" +name = "Mako" +version = "1.2.2" description = "A super-fast templating language that borrows the best ideas from the existing templating languages." category = "main" optional = false @@ -89,7 +89,7 @@ python-versions = ">=3.7" MarkupSafe = ">=0.9.2" [package.extras] -babel = ["babel"] +babel = ["Babel"] lingua = ["lingua"] testing = ["pytest"] @@ -133,7 +133,7 @@ parse = {version = ">=1.18.0", markers = "python_version >= \"3.0\""} six = ">=1.11" [package.extras] -develop = ["coverage (>=4.4)", "pytest-html (>=1.19.0)", "pytest-cov", "tox (>=2.8)", "pytest (<5.0)", "pytest (>=5.0)"] +develop = ["coverage (>=4.4)", "pytest (<5.0)", "pytest (>=5.0)", "pytest-cov", "pytest-html (>=1.19.0)", "tox (>=2.8)"] docs = ["sphinx (>=1.2)"] [[package]] @@ -165,7 +165,7 @@ optional = false python-versions = ">=3.6.8" [package.extras] -diagrams = ["railroad-diagrams", "jinja2"] +diagrams = ["jinja2", "railroad-diagrams"] [[package]] name = "pytest" @@ -241,8 +241,8 @@ python-versions = ">=3.7" [metadata] lock-version = "1.1" -python-versions = "^3.9" -content-hash = "80a2062ea092ebad9bc129f47fed878c60b0880191ded2019679fe0dd6b61219" +python-versions = "^3.10" +content-hash = "3c345ad264c173fcd21973be74a1409faece937a39678093a3cb3799110962d2" [metadata.files] atomicwrites = [ @@ -276,9 +276,9 @@ jsonref = [ {file = "jsonref-0.2-py3-none-any.whl", hash = "sha256:b1e82fa0b62e2c2796a13e5401fe51790b248f6d9bf9d7212a3e31a3501b291f"}, {file = "jsonref-0.2.tar.gz", hash = "sha256:f3c45b121cf6257eafabdc3a8008763aed1cd7da06dbabc59a9e4d2a5e4e6697"}, ] -mako = [ - {file = "Mako-1.2.0-py3-none-any.whl", hash = "sha256:23aab11fdbbb0f1051b93793a58323ff937e98e34aece1c4219675122e57e4ba"}, - {file = "Mako-1.2.0.tar.gz", hash = "sha256:9a7c7e922b87db3686210cf49d5d767033a41d4010b284e747682c92bddd8b39"}, +Mako = [ + {file = "Mako-1.2.2-py3-none-any.whl", hash = "sha256:8efcb8004681b5f71d09c983ad5a9e6f5c40601a6ec469148753292abc0da534"}, + {file = "Mako-1.2.2.tar.gz", hash = "sha256:3724869b363ba630a272a5f89f68c070352137b8fd1757650017b7e06fda163f"}, ] markupsafe = [ {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812"}, @@ -365,6 +365,13 @@ pyyaml = [ {file = "PyYAML-6.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5"}, {file = "PyYAML-6.0-cp310-cp310-win32.whl", hash = "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513"}, {file = "PyYAML-6.0-cp310-cp310-win_amd64.whl", hash = "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a"}, + {file = "PyYAML-6.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:d4b0ba9512519522b118090257be113b9468d804b19d63c71dbcf4a48fa32358"}, + {file = "PyYAML-6.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:81957921f441d50af23654aa6c5e5eaf9b06aba7f0a19c18a538dc7ef291c5a1"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:afa17f5bc4d1b10afd4466fd3a44dc0e245382deca5b3c353d8b757f9e3ecb8d"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f"}, + {file = "PyYAML-6.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:432557aa2c09802be39460360ddffd48156e30721f5e8d917f01d31694216782"}, + {file = "PyYAML-6.0-cp311-cp311-win32.whl", hash = "sha256:bfaef573a63ba8923503d27530362590ff4f576c626d86a9fed95822a8255fd7"}, + {file = "PyYAML-6.0-cp311-cp311-win_amd64.whl", hash = "sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf"}, {file = "PyYAML-6.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86"}, {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f"}, {file = "PyYAML-6.0-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92"}, From f194329974052b21aa9ab5aa3eeb4b90511cf8fd Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 13:55:02 -0400 Subject: [PATCH 17/30] Regenerate client from commit acc0b78b of spec repo (#835) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: skarimo <40482491+skarimo@users.noreply.github.com> --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 32 ++++- .generator/schemas/v2/openapi.yaml | 3 +- .../frozen.json | 1 + .../recording.har | 67 +++++++++++ .../frozen.json | 1 + .../recording.har | 110 ++++++++++++++++++ .../frozen.json | 1 + .../recording.har | 67 +++++++++++ .../frozen.json | 1 + .../recording.har | 67 +++++++++++ .../frozen.json | 1 + .../recording.har | 110 ++++++++++++++++++ .../frozen.json | 1 + .../recording.har | 67 +++++++++++ .../dashboards/CreateDashboard_2850365602.ts | 60 ++++++++++ .../dashboards/CreateDashboard_858397694.ts | 49 ++++++++ features/v1/dashboards.feature | 41 ++++++- .../models/DashboardTemplateVariable.ts | 10 +- .../DashboardTemplateVariablePresetValue.ts | 10 +- 20 files changed, 695 insertions(+), 12 deletions(-) create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-and-default-returns-Bad-Request-re_1070954728/frozen.json create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-and-default-returns-Bad-Request-re_1070954728/recording.har create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-returns-OK-response_2788860418/frozen.json create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-returns-OK-response_2788860418/recording.har create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-whose-value-has-no-length-returns-_3428927772/frozen.json create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-whose-value-has-no-length-returns-_3428927772/recording.har create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-and-value-returns-Bad-_4007590136/frozen.json create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-and-value-returns-Bad-_4007590136/recording.har create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-returns-OK-response_659673966/frozen.json create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-returns-OK-response_659673966/recording.har create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-with-no-length-returns_1736692679/frozen.json create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-with-no-length-returns_1736692679/recording.har create mode 100644 examples/v1/dashboards/CreateDashboard_2850365602.ts create mode 100644 examples/v1/dashboards/CreateDashboard_858397694.ts diff --git a/.apigentools-info b/.apigentools-info index 28bbb6250693..a46cf5d10c08 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-14 07:52:45.759185", - "spec_repo_commit": "4e5b7510" + "regenerated": "2022-09-16 13:42:45.233492", + "spec_repo_commit": "acc0b78b" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-14 07:52:45.775321", - "spec_repo_commit": "4e5b7510" + "regenerated": "2022-09-16 13:42:45.245964", + "spec_repo_commit": "acc0b78b" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 8260d4297873..2990ab08c55a 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -1250,10 +1250,25 @@ components: nullable: true type: array default: - description: The default value for the template variable on dashboard load. + deprecated: true + description: (deprecated) The default value for the template variable on + dashboard load. Cannot be used in conjunction with `defaults`. example: my-host nullable: true type: string + defaults: + description: One or many default values for template variables on load. + If more than one default is specified, they will be unioned together with + `OR`. Cannot be used in conjunction with `default`. + example: + - my-host-1 + - my-host-2 + items: + description: One of many default values for the template variable on dashboard + load. + minLength: 1 + type: string + type: array name: description: The name of the variable. example: host1 @@ -1286,8 +1301,21 @@ components: description: The name of the variable. type: string value: - description: The value of the template variable within the saved view. + deprecated: true + description: (deprecated) The value of the template variable within the + saved view. Cannot be used in conjunction with `values`. type: string + values: + description: One or many template variable values within the saved view, + which will be unioned together using `OR` if more than one is specified. + Cannot be used in conjunction with `value`. + items: + description: One or many values of the template variable within the saved + view. + minLength: 1 + type: string + minItems: 1 + type: array type: object DeletedMonitor: description: Response from the delete monitor call. diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ef1c74ffe488..1d5411b1cc88 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -10931,7 +10931,8 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - metrics_read summary: List active tags and aggregations tags: - Metrics diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-and-default-returns-Bad-Request-re_1070954728/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-and-default-returns-Bad-Request-re_1070954728/frozen.json new file mode 100644 index 000000000000..79931f003ee8 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-and-default-returns-Bad-Request-re_1070954728/frozen.json @@ -0,0 +1 @@ +"2022-09-12T20:05:48.540Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-and-default-returns-Bad-Request-re_1070954728/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-and-default-returns-Bad-Request-re_1070954728/recording.har new file mode 100644 index 000000000000..2e77731c69ae --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-and-default-returns-Bad-Request-re_1070954728/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with template variable defaults and default returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "8588e1ea2dacd091388b5219856564c1", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 379, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":null,\"is_read_only\":false,\"layout_type\":\"ordered\",\"notify_list\":[],\"reflow_type\":\"auto\",\"restricted_roles\":[],\"template_variables\":[{\"available_values\":[\"my-host\",\"host1\",\"host2\"],\"default\":\"my-host\",\"defaults\":[\"my-host\"],\"name\":\"host1\",\"prefix\":\"host\"}],\"title\":\"\",\"widgets\":[{\"definition\":{\"requests\":{\"fill\":{\"q\":\"avg:system.cpu.user{*}\"}},\"type\":\"hostmap\"}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 47, + "content": { + "mimeType": "application/json", + "size": 47, + "text": "{\"errors\":[\"'template_variables' is invalid\"]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 635, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2022-09-12T20:05:48.556Z", + "time": 164 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-returns-OK-response_2788860418/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-returns-OK-response_2788860418/frozen.json new file mode 100644 index 000000000000..f852402a702b --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-returns-OK-response_2788860418/frozen.json @@ -0,0 +1 @@ +"2022-09-12T20:05:48.730Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-returns-OK-response_2788860418/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-returns-OK-response_2788860418/recording.har new file mode 100644 index 000000000000..cd35f54d15bf --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-returns-OK-response_2788860418/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with template variable defaults returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "bc9e8ee1e35da8c1128da24e2d821943", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 359, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":null,\"is_read_only\":false,\"layout_type\":\"ordered\",\"notify_list\":[],\"reflow_type\":\"auto\",\"restricted_roles\":[],\"template_variables\":[{\"available_values\":[\"my-host\",\"host1\",\"host2\"],\"defaults\":[\"my-host\"],\"name\":\"host1\",\"prefix\":\"host\"}],\"title\":\"\",\"widgets\":[{\"definition\":{\"requests\":{\"fill\":{\"q\":\"avg:system.cpu.user{*}\"}},\"type\":\"hostmap\"}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 586, + "content": { + "mimeType": "application/json", + "size": 586, + "text": "{\"notify_list\":[],\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":[{\"prefix\":\"host\",\"defaults\":[\"my-host\"],\"available_values\":[\"my-host\",\"host1\",\"host2\"],\"name\":\"host1\"}],\"is_read_only\":false,\"id\":\"39h-cn5-kyd\",\"title\":\"\",\"url\":\"/dashboard/39h-cn5-kyd/\",\"created_at\":\"2022-09-12T20:05:49.753763+00:00\",\"modified_at\":\"2022-09-12T20:05:49.753763+00:00\",\"reflow_type\":\"auto\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"requests\":{\"fill\":{\"q\":\"avg:system.cpu.user{*}\"}},\"type\":\"hostmap\"},\"id\":4911408545233424}],\"layout_type\":\"ordered\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 593, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-12T20:05:48.735Z", + "time": 1059 + }, + { + "_id": "589d25a818d1f9ae097de8af0e381784", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 520, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard/39h-cn5-kyd" + }, + "response": { + "bodySize": 39, + "content": { + "mimeType": "application/json", + "size": 39, + "text": "{\"deleted_dashboard_id\":\"39h-cn5-kyd\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 592, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-12T20:05:49.820Z", + "time": 198 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-whose-value-has-no-length-returns-_3428927772/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-whose-value-has-no-length-returns-_3428927772/frozen.json new file mode 100644 index 000000000000..60875e3a6ec6 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-whose-value-has-no-length-returns-_3428927772/frozen.json @@ -0,0 +1 @@ +"2022-09-12T20:05:50.024Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-whose-value-has-no-length-returns-_3428927772/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-whose-value-has-no-length-returns-_3428927772/recording.har new file mode 100644 index 000000000000..d7762f6ad8d9 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-defaults-whose-value-has-no-length-returns-_3428927772/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with template variable defaults whose value has no length returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "46a0f6ac2198ca813563f3642a435388", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 352, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":null,\"is_read_only\":false,\"layout_type\":\"ordered\",\"notify_list\":[],\"reflow_type\":\"auto\",\"restricted_roles\":[],\"template_variables\":[{\"available_values\":[\"my-host\",\"host1\",\"host2\"],\"defaults\":[\"\"],\"name\":\"host1\",\"prefix\":\"host\"}],\"title\":\"\",\"widgets\":[{\"definition\":{\"requests\":{\"fill\":{\"q\":\"avg:system.cpu.user{*}\"}},\"type\":\"hostmap\"}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 66, + "content": { + "mimeType": "application/json", + "size": 66, + "text": "{\"errors\":[\"Minimum length of parameter 'defaults' should be 1\"]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 635, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2022-09-12T20:05:50.028Z", + "time": 90 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-and-value-returns-Bad-_4007590136/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-and-value-returns-Bad-_4007590136/frozen.json new file mode 100644 index 000000000000..8f6643084109 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-and-value-returns-Bad-_4007590136/frozen.json @@ -0,0 +1 @@ +"2022-09-14T15:56:53.597Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-and-value-returns-Bad-_4007590136/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-and-value-returns-Bad-_4007590136/recording.har new file mode 100644 index 000000000000..e7994cc49082 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-and-value-returns-Bad-_4007590136/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with template variable presets using values and value returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "19c54e472621b960df984e9aacb783cc", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 486, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":null,\"is_read_only\":false,\"layout_type\":\"ordered\",\"notify_list\":[],\"reflow_type\":\"auto\",\"restricted_roles\":[],\"template_variable_presets\":[{\"name\":\"my saved view\",\"template_variables\":[{\"name\":\"datacenter\",\"value\":\"*\",\"values\":[\"*\"]}]}],\"template_variables\":[{\"available_values\":[\"my-host\",\"host1\",\"host2\"],\"defaults\":[\"my-host\"],\"name\":\"host1\",\"prefix\":\"host\"}],\"title\":\"\",\"widgets\":[{\"definition\":{\"requests\":{\"fill\":{\"q\":\"avg:system.cpu.user{*}\"}},\"type\":\"hostmap\"}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 114, + "content": { + "mimeType": "application/json", + "size": 114, + "text": "{\"errors\":[\"'template_variables' value '{u'values': [u'*'], u'name': u'datacenter', u'value': u'*'}' is invalid\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 635, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2022-09-14T15:56:53.618Z", + "time": 168 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-returns-OK-response_659673966/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-returns-OK-response_659673966/frozen.json new file mode 100644 index 000000000000..7eed88ccf802 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-returns-OK-response_659673966/frozen.json @@ -0,0 +1 @@ +"2022-09-12T20:05:50.228Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-returns-OK-response_659673966/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-returns-OK-response_659673966/recording.har new file mode 100644 index 000000000000..7567614431f0 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-returns-OK-response_659673966/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with template variable presets using values returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "e28d6f473c558c5cc922157e7713ba63", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 484, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":null,\"is_read_only\":false,\"layout_type\":\"ordered\",\"notify_list\":[],\"reflow_type\":\"auto\",\"restricted_roles\":[],\"template_variable_presets\":[{\"name\":\"my saved view\",\"template_variables\":[{\"name\":\"datacenter\",\"values\":[\"*\",\"my-host\"]}]}],\"template_variables\":[{\"available_values\":[\"my-host\",\"host1\",\"host2\"],\"defaults\":[\"my-host\"],\"name\":\"host1\",\"prefix\":\"host\"}],\"title\":\"\",\"widgets\":[{\"definition\":{\"requests\":{\"fill\":{\"q\":\"avg:system.cpu.user{*}\"}},\"type\":\"hostmap\"}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 711, + "content": { + "mimeType": "application/json", + "size": 711, + "text": "{\"notify_list\":[],\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variable_presets\":[{\"template_variables\":[{\"values\":[\"*\",\"my-host\"],\"name\":\"datacenter\"}],\"name\":\"my saved view\"}],\"template_variables\":[{\"prefix\":\"host\",\"defaults\":[\"my-host\"],\"available_values\":[\"my-host\",\"host1\",\"host2\"],\"name\":\"host1\"}],\"is_read_only\":false,\"id\":\"6j2-ja3-r9z\",\"title\":\"\",\"url\":\"/dashboard/6j2-ja3-r9z/\",\"created_at\":\"2022-09-12T20:05:50.380181+00:00\",\"modified_at\":\"2022-09-12T20:05:50.380181+00:00\",\"reflow_type\":\"auto\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"requests\":{\"fill\":{\"q\":\"avg:system.cpu.user{*}\"}},\"type\":\"hostmap\"},\"id\":8337056750682432}],\"layout_type\":\"ordered\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 593, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-12T20:05:50.232Z", + "time": 184 + }, + { + "_id": "d5b7bed1153628b2bc2ff67f8977302b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 519, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard/6j2-ja3-r9z" + }, + "response": { + "bodySize": 39, + "content": { + "mimeType": "application/json", + "size": 39, + "text": "{\"deleted_dashboard_id\":\"6j2-ja3-r9z\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 592, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-12T20:05:50.422Z", + "time": 158 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-with-no-length-returns_1736692679/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-with-no-length-returns_1736692679/frozen.json new file mode 100644 index 000000000000..952c1ef92d82 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-with-no-length-returns_1736692679/frozen.json @@ -0,0 +1 @@ +"2022-09-14T16:53:46.508Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-with-no-length-returns_1736692679/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-with-no-length-returns_1736692679/recording.har new file mode 100644 index 000000000000..4f02463f6556 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-template-variable-presets-using-values-with-no-length-returns_1736692679/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with template variable presets using values with no length returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "a4e26fe89d761ccc9a047e934e1b6286", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 471, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":null,\"is_read_only\":false,\"layout_type\":\"ordered\",\"notify_list\":[],\"reflow_type\":\"auto\",\"restricted_roles\":[],\"template_variable_presets\":[{\"name\":\"my saved view\",\"template_variables\":[{\"name\":\"datacenter\",\"values\":[]}]}],\"template_variables\":[{\"available_values\":[\"my-host\",\"host1\",\"host2\"],\"defaults\":[\"my-host\"],\"name\":\"host1\",\"prefix\":\"host\"}],\"title\":\"\",\"widgets\":[{\"definition\":{\"requests\":{\"fill\":{\"q\":\"avg:system.cpu.user{*}\"}},\"type\":\"hostmap\"}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 75, + "content": { + "mimeType": "application/json", + "size": 75, + "text": "{\"errors\":[\"Minimum number of elements in parameter 'values' should be 1\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 635, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2022-09-14T16:53:46.531Z", + "time": 1159 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v1/dashboards/CreateDashboard_2850365602.ts b/examples/v1/dashboards/CreateDashboard_2850365602.ts new file mode 100644 index 000000000000..0bd10955a7a8 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_2850365602.ts @@ -0,0 +1,60 @@ +/** + * Create a new dashboard with template variable presets using values returns "OK" response + */ + +import { client, v1 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v1.DashboardsApi(configuration); + +const params: v1.DashboardsApiCreateDashboardRequest = { + body: { + description: undefined, + isReadOnly: false, + layoutType: "ordered", + notifyList: [], + reflowType: "auto", + restrictedRoles: [], + templateVariablePresets: [ + { + name: "my saved view", + templateVariables: [ + { + name: "datacenter", + values: ["*", "my-host"], + }, + ], + }, + ], + templateVariables: [ + { + availableValues: ["my-host", "host1", "host2"], + defaults: ["my-host"], + name: "host1", + prefix: "host", + }, + ], + title: "", + widgets: [ + { + definition: { + requests: { + fill: { + q: "avg:system.cpu.user{*}", + }, + }, + type: "hostmap", + }, + }, + ], + }, +}; + +apiInstance + .createDashboard(params) + .then((data: v1.Dashboard) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v1/dashboards/CreateDashboard_858397694.ts b/examples/v1/dashboards/CreateDashboard_858397694.ts new file mode 100644 index 000000000000..58e372db6229 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_858397694.ts @@ -0,0 +1,49 @@ +/** + * Create a new dashboard with template variable defaults returns "OK" response + */ + +import { client, v1 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v1.DashboardsApi(configuration); + +const params: v1.DashboardsApiCreateDashboardRequest = { + body: { + description: undefined, + isReadOnly: false, + layoutType: "ordered", + notifyList: [], + reflowType: "auto", + restrictedRoles: [], + templateVariables: [ + { + availableValues: ["my-host", "host1", "host2"], + defaults: ["my-host"], + name: "host1", + prefix: "host", + }, + ], + title: "", + widgets: [ + { + definition: { + requests: { + fill: { + q: "avg:system.cpu.user{*}", + }, + }, + type: "hostmap", + }, + }, + ], + }, +}; + +apiInstance + .createDashboard(params) + .then((data: v1.Dashboard) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index ef0406843d30..cdb446a2b9cf 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -57,7 +57,7 @@ Feature: Dashboards @generated @skip @team:DataDog/dashboards Scenario: Create a new dashboard returns "Bad Request" response Given new "CreateDashboard" request - And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variable_presets": [{"template_variables": [{}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]} + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]} When the request is sent Then the response status is 400 Bad Request @@ -413,6 +413,41 @@ Feature: Dashboards And the response "widgets[0].definition.requests[0].queries[0].aggregator" is equal to "sum" And the response "widgets[0].definition.requests[0].formulas[0].formula" is equal to "query1" + @skip-typescript @team:DataDog/dashboards + Scenario: Create a new dashboard with template variable defaults and default returns "Bad Request" response + Given new "CreateDashboard" request + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host"], "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/dashboards + Scenario: Create a new dashboard with template variable defaults returns "OK" response + Given new "CreateDashboard" request + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "defaults": ["my-host"], "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/dashboards + Scenario: Create a new dashboard with template variable defaults whose value has no length returns "Bad Request" response + Given new "CreateDashboard" request + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "defaults": [""], "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/dashboards + Scenario: Create a new dashboard with template variable presets using values and value returns "Bad Request" response + Given new "CreateDashboard" request + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variable_presets": [{"name": "my saved view", "template_variables": [{"name": "datacenter", "value": "*", "values": [ "*" ]}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "defaults": ["my-host"], "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/dashboards + Scenario: Create a new dashboard with template variable presets using values returns "OK" response + Given new "CreateDashboard" request + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variable_presets": [{"name": "my saved view", "template_variables": [{"name": "datacenter", "values": ["*", "my-host"]}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "defaults": ["my-host"], "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]} + When the request is sent + Then the response status is 200 OK + @team:DataDog/dashboards Scenario: Create a new dashboard with timeseries widget containing style attributes Given new "CreateDashboard" request @@ -569,7 +604,7 @@ Feature: Dashboards Scenario: Update a dashboard returns "Bad Request" response Given new "UpdateDashboard" request And request contains "dashboard_id" parameter from "REPLACE.ME" - And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variable_presets": [{"template_variables": [{}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]} + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]} When the request is sent Then the response status is 400 Bad Request @@ -577,7 +612,7 @@ Feature: Dashboards Scenario: Update a dashboard returns "Item Not Found" response Given new "UpdateDashboard" request And request contains "dashboard_id" parameter from "REPLACE.ME" - And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variable_presets": [{"template_variables": [{}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]} + And body with value {"description": null, "is_read_only": false, "layout_type": "ordered", "notify_list": [], "reflow_type": "auto", "restricted_roles": [], "template_variable_presets": [{"template_variables": [{"values": []}]}], "template_variables": [{"available_values": ["my-host", "host1", "host2"], "default": "my-host", "defaults": ["my-host-1", "my-host-2"], "name": "host1", "prefix": "host"}], "title": "", "widgets": [{"definition": {"requests": {"fill": {"q": "avg:system.cpu.user{*}"}}, "type": "hostmap"}}]} When the request is sent Then the response status is 404 Item Not Found diff --git a/packages/datadog-api-client-v1/models/DashboardTemplateVariable.ts b/packages/datadog-api-client-v1/models/DashboardTemplateVariable.ts index d4ac6a84ba27..84b5957620f0 100644 --- a/packages/datadog-api-client-v1/models/DashboardTemplateVariable.ts +++ b/packages/datadog-api-client-v1/models/DashboardTemplateVariable.ts @@ -15,9 +15,13 @@ export class DashboardTemplateVariable { */ "availableValues"?: Array; /** - * The default value for the template variable on dashboard load. + * (deprecated) The default value for the template variable on dashboard load. Cannot be used in conjunction with `defaults`. */ "_default"?: string; + /** + * One or many default values for template variables on load. If more than one default is specified, they will be unioned together with `OR`. Cannot be used in conjunction with `default`. + */ + "defaults"?: Array; /** * The name of the variable. */ @@ -44,6 +48,10 @@ export class DashboardTemplateVariable { baseName: "default", type: "string", }, + defaults: { + baseName: "defaults", + type: "Array", + }, name: { baseName: "name", type: "string", diff --git a/packages/datadog-api-client-v1/models/DashboardTemplateVariablePresetValue.ts b/packages/datadog-api-client-v1/models/DashboardTemplateVariablePresetValue.ts index 0644aead0a03..5f315a4b6372 100644 --- a/packages/datadog-api-client-v1/models/DashboardTemplateVariablePresetValue.ts +++ b/packages/datadog-api-client-v1/models/DashboardTemplateVariablePresetValue.ts @@ -15,9 +15,13 @@ export class DashboardTemplateVariablePresetValue { */ "name"?: string; /** - * The value of the template variable within the saved view. + * (deprecated) The value of the template variable within the saved view. Cannot be used in conjunction with `values`. */ "value"?: string; + /** + * One or many template variable values within the saved view, which will be unioned together using `OR` if more than one is specified. Cannot be used in conjunction with `value`. + */ + "values"?: Array; /** * @ignore @@ -36,6 +40,10 @@ export class DashboardTemplateVariablePresetValue { baseName: "value", type: "string", }, + values: { + baseName: "values", + type: "Array", + }, }; /** From ec3150fc2d5a066229444693d7904c51dd5b6489 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 09:25:49 +0000 Subject: [PATCH 18/30] Regenerate client from commit 7f715655 of spec repo (#840) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 8 ++ .../frozen.json | 2 +- .../recording.har | 34 +++--- .../frozen.json | 1 + .../recording.har | 110 ++++++++++++++++++ .../frozen.json | 1 + .../recording.har | 110 ++++++++++++++++++ .../dashboards/CreateDashboard_3117424216.ts | 48 ++++++++ .../dashboards/CreateDashboard_3669695268.ts | 63 ++++++++++ features/v1/dashboards.feature | 20 ++++ .../FormulaAndFunctionEventQueryDefinition.ts | 8 ++ .../models/ListStreamQuery.ts | 8 ++ 13 files changed, 399 insertions(+), 22 deletions(-) create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs-query-table-widget-and-storage-parameter_2530584782/frozen.json create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs-query-table-widget-and-storage-parameter_2530584782/recording.har create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs_stream-list_stream-widget-and-storage-parameter_4265762872/frozen.json create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs_stream-list_stream-widget-and-storage-parameter_4265762872/recording.har create mode 100644 examples/v1/dashboards/CreateDashboard_3117424216.ts create mode 100644 examples/v1/dashboards/CreateDashboard_3669695268.ts diff --git a/.apigentools-info b/.apigentools-info index a46cf5d10c08..cf4626d051d9 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-16 13:42:45.233492", - "spec_repo_commit": "acc0b78b" + "regenerated": "2022-09-22 15:10:38.455972", + "spec_repo_commit": "7f715655" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-16 13:42:45.245964", - "spec_repo_commit": "acc0b78b" + "regenerated": "2022-09-22 15:10:38.471408", + "spec_repo_commit": "7f715655" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 2990ab08c55a..cb2f1640dc0a 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -2440,6 +2440,10 @@ components: type: string search: $ref: '#/components/schemas/FormulaAndFunctionEventQueryDefinitionSearch' + storage: + description: Option for storage location. Feature in Private Beta. + example: indexes + type: string required: - data_source - compute @@ -4025,6 +4029,10 @@ components: description: Widget query. example: '@service:app' type: string + storage: + description: Option for storage location. Feature in Private Beta. + example: indexes + type: string required: - query_string - data_source diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-apm_issue_stream-list_stream-widget_4088765868/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-apm_issue_stream-list_stream-widget_4088765868/frozen.json index cf21f9565e83..b17987eafa64 100644 --- a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-apm_issue_stream-list_stream-widget_4088765868/frozen.json +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-apm_issue_stream-list_stream-widget_4088765868/frozen.json @@ -1 +1 @@ -"2022-04-05T17:19:04.966Z" +"2022-09-22T14:46:14.443Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-apm_issue_stream-list_stream-widget_4088765868/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-apm_issue_stream-list_stream-widget_4088765868/recording.har index 6fe92cdc6891..e78edf132839 100644 --- a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-apm_issue_stream-list_stream-widget_4088765868/recording.har +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-apm_issue_stream-list_stream-widget_4088765868/recording.har @@ -4,11 +4,11 @@ "creator": { "comment": "persister:fs", "name": "Polly.JS", - "version": "6.0.4" + "version": "6.0.5" }, "entries": [ { - "_id": "592f18644f69193f1e5070a785ccc101", + "_id": "e134fad19a8ef2e56b47e08d76adddc3", "_order": 0, "cache": {}, "request": { @@ -32,17 +32,17 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_apm_issue_stream_list_stream_widget-1649179144 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}],\"query\":{\"data_source\":\"apm_issue_stream\",\"query_string\":\"\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}" + "text": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_apm_issue_stream_list_stream_widget-1663857974 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}],\"query\":{\"data_source\":\"apm_issue_stream\",\"query_string\":\"\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/dashboard" }, "response": { - "bodySize": 758, + "bodySize": 759, "content": { "mimeType": "application/json", - "size": 758, - "text": "{\"notify_list\":null,\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":null,\"is_read_only\":false,\"id\":\"fbq-m3y-6wb\",\"title\":\"Test-Create_a_new_dashboard_with_apm_issue_stream_list_stream_widget-1649179144 with list_stream widget\",\"url\":\"/dashboard/fbq-m3y-6wb/test-createanewdashboardwithapmissuestreamliststreamwidget-1649179144-with-lists\",\"created_at\":\"2022-04-05T17:19:05.083182+00:00\",\"modified_at\":\"2022-04-05T17:19:05.083182+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"query_string\":\"\",\"data_source\":\"apm_issue_stream\"},\"response_format\":\"event_list\",\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}]}],\"type\":\"list_stream\"},\"id\":2589925713372507}],\"layout_type\":\"ordered\"}" + "size": 759, + "text": "{\"notify_list\":null,\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":null,\"is_read_only\":false,\"id\":\"xhp-ymt-7mz\",\"title\":\"Test-Create_a_new_dashboard_with_apm_issue_stream_list_stream_widget-1663857974 with list_stream widget\",\"url\":\"/dashboard/xhp-ymt-7mz/test-createanewdashboardwithapmissuestreamliststreamwidget-1663857974-with-lists\",\"created_at\":\"2022-09-22T14:46:14.861195+00:00\",\"modified_at\":\"2022-09-22T14:46:14.861195+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"query_string\":\"\",\"data_source\":\"apm_issue_stream\"},\"response_format\":\"event_list\",\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}]}],\"type\":\"list_stream\"},\"id\":8154733979358236}],\"layout_type\":\"ordered\"}\n" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 636, + "headersSize": 593, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-04-05T17:19:04.983Z", - "time": 148 + "startedDateTime": "2022-09-22T14:46:14.454Z", + "time": 487 }, { - "_id": "4d9ff34bccb14f6bba3d6cf269dc8169", + "_id": "24b16955838d319143fec9f71338e960", "_order": 0, "cache": {}, "request": { @@ -78,14 +78,14 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/dashboard/fbq-m3y-6wb" + "url": "https://api.datadoghq.com/api/v1/dashboard/xhp-ymt-7mz" }, "response": { - "bodySize": 38, + "bodySize": 39, "content": { "mimeType": "application/json", - "size": 38, - "text": "{\"deleted_dashboard_id\":\"fbq-m3y-6wb\"}" + "size": 39, + "text": "{\"deleted_dashboard_id\":\"xhp-ymt-7mz\"}\n" }, "cookies": [], "headers": [ @@ -94,14 +94,14 @@ "value": "application/json" } ], - "headersSize": 635, + "headersSize": 592, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-04-05T17:19:05.140Z", - "time": 195 + "startedDateTime": "2022-09-22T14:46:14.962Z", + "time": 726 } ], "pages": [], diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs-query-table-widget-and-storage-parameter_2530584782/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs-query-table-widget-and-storage-parameter_2530584782/frozen.json new file mode 100644 index 000000000000..84b9c5de30a8 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs-query-table-widget-and-storage-parameter_2530584782/frozen.json @@ -0,0 +1 @@ +"2022-09-22T15:06:29.061Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs-query-table-widget-and-storage-parameter_2530584782/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs-query-table-widget-and-storage-parameter_2530584782/recording.har new file mode 100644 index 000000000000..a2ac01b4d32e --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs-query-table-widget-and-storage-parameter_2530584782/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with logs query table widget and storage parameter", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "1cb538b3fc0e8bfa7b4969d32a40901e", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 549, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_logs_query_table_widget_and_storage_parameter-1663859189 with query table widget and storage parameter\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"cell_display_mode\":\"bar\",\"conditional_formats\":[],\"formula\":\"query1\",\"limit\":{\"count\":50,\"order\":\"desc\"}}],\"queries\":[{\"compute\":{\"aggregation\":\"count\"},\"data_source\":\"logs\",\"group_by\":[],\"indexes\":[\"*\"],\"name\":\"query1\",\"search\":{\"query\":\"\"},\"storage\":\"online_archives\"}],\"response_format\":\"scalar\"}],\"type\":\"query_table\"}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 963, + "content": { + "mimeType": "application/json", + "size": 963, + "text": "{\"notify_list\":null,\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":null,\"is_read_only\":false,\"id\":\"3my-5nt-jfx\",\"title\":\"Test-Create_a_new_dashboard_with_logs_query_table_widget_and_storage_parameter-1663859189 with query table widget and storage parameter\",\"url\":\"/dashboard/3my-5nt-jfx/test-createanewdashboardwithlogsquerytablewidgetandstorageparameter-1663859189-w\",\"created_at\":\"2022-09-22T15:06:29.565373+00:00\",\"modified_at\":\"2022-09-22T15:06:29.565373+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"requests\":[{\"formulas\":[{\"formula\":\"query1\",\"cell_display_mode\":\"bar\",\"limit\":{\"count\":50,\"order\":\"desc\"},\"conditional_formats\":[]}],\"response_format\":\"scalar\",\"queries\":[{\"search\":{\"query\":\"\"},\"data_source\":\"logs\",\"compute\":{\"aggregation\":\"count\"},\"name\":\"query1\",\"storage\":\"online_archives\",\"indexes\":[\"*\"],\"group_by\":[]}]}],\"type\":\"query_table\"},\"id\":7645558730591730}],\"layout_type\":\"ordered\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 593, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-22T15:06:29.072Z", + "time": 592 + }, + { + "_id": "e7f5660d4f8f518d8072266306b32016", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 520, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard/3my-5nt-jfx" + }, + "response": { + "bodySize": 39, + "content": { + "mimeType": "application/json", + "size": 39, + "text": "{\"deleted_dashboard_id\":\"3my-5nt-jfx\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 592, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-22T15:06:29.680Z", + "time": 401 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs_stream-list_stream-widget-and-storage-parameter_4265762872/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs_stream-list_stream-widget-and-storage-parameter_4265762872/frozen.json new file mode 100644 index 000000000000..ef7c226c13fa --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs_stream-list_stream-widget-and-storage-parameter_4265762872/frozen.json @@ -0,0 +1 @@ +"2022-09-22T15:06:54.976Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs_stream-list_stream-widget-and-storage-parameter_4265762872/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs_stream-list_stream-widget-and-storage-parameter_4265762872/recording.har new file mode 100644 index 000000000000..96b1dfc654ec --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-logs_stream-list_stream-widget-and-storage-parameter_4265762872/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with logs_stream list_stream widget and storage parameter", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "8cdd894adfe5b48221a40a892aedc1a5", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 373, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 559, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"layout_type\":\"ordered\",\"title\":\"Test-Create_a_new_dashboard_with_logs_stream_list_stream_widget_and_storage_parameter-1663859214 with list_stream widget\",\"widgets\":[{\"definition\":{\"requests\":[{\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}],\"query\":{\"data_source\":\"logs_stream\",\"query_string\":\"\",\"storage\":\"hot\"},\"response_format\":\"event_list\"}],\"type\":\"list_stream\"}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 787, + "content": { + "mimeType": "application/json", + "size": 787, + "text": "{\"notify_list\":null,\"description\":null,\"restricted_roles\":[],\"author_name\":null,\"template_variables\":null,\"is_read_only\":false,\"id\":\"4w4-hsv-5rr\",\"title\":\"Test-Create_a_new_dashboard_with_logs_stream_list_stream_widget_and_storage_parameter-1663859214 with list_stream widget\",\"url\":\"/dashboard/4w4-hsv-5rr/test-createanewdashboardwithlogsstreamliststreamwidgetandstorageparameter-166385\",\"created_at\":\"2022-09-22T15:06:55.408450+00:00\",\"modified_at\":\"2022-09-22T15:06:55.408450+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"query_string\":\"\",\"data_source\":\"logs_stream\",\"storage\":\"hot\"},\"response_format\":\"event_list\",\"columns\":[{\"field\":\"timestamp\",\"width\":\"auto\"}]}],\"type\":\"list_stream\"},\"id\":4554037011373131}],\"layout_type\":\"ordered\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 592, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-22T15:06:54.987Z", + "time": 502 + }, + { + "_id": "cb8fc333c63c3f946fdde3840f1c567a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 520, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard/4w4-hsv-5rr" + }, + "response": { + "bodySize": 39, + "content": { + "mimeType": "application/json", + "size": 39, + "text": "{\"deleted_dashboard_id\":\"4w4-hsv-5rr\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 591, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-22T15:06:55.515Z", + "time": 429 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v1/dashboards/CreateDashboard_3117424216.ts b/examples/v1/dashboards/CreateDashboard_3117424216.ts new file mode 100644 index 000000000000..80224208ada2 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_3117424216.ts @@ -0,0 +1,48 @@ +/** + * Create a new dashboard with logs_stream list_stream widget and storage parameter + */ + +import { client, v1 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v1.DashboardsApi(configuration); + +const params: v1.DashboardsApiCreateDashboardRequest = { + body: { + layoutType: "ordered", + title: + "Example-Create_a_new_dashboard_with_logs_stream_list_stream_widget_and_storage_parameter with list_stream widget", + widgets: [ + { + definition: { + type: "list_stream", + requests: [ + { + columns: [ + { + width: "auto", + field: "timestamp", + }, + ], + query: { + dataSource: "logs_stream", + queryString: "", + storage: "hot", + }, + responseFormat: "event_list", + }, + ], + }, + }, + ], + }, +}; + +apiInstance + .createDashboard(params) + .then((data: v1.Dashboard) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v1/dashboards/CreateDashboard_3669695268.ts b/examples/v1/dashboards/CreateDashboard_3669695268.ts new file mode 100644 index 000000000000..ba68e7aaaf75 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_3669695268.ts @@ -0,0 +1,63 @@ +/** + * Create a new dashboard with logs query table widget and storage parameter + */ + +import { client, v1 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v1.DashboardsApi(configuration); + +const params: v1.DashboardsApiCreateDashboardRequest = { + body: { + layoutType: "ordered", + title: + "Example-Create_a_new_dashboard_with_logs_query_table_widget_and_storage_parameter with query table widget and storage parameter", + widgets: [ + { + definition: { + type: "query_table", + requests: [ + { + queries: [ + { + dataSource: "logs", + name: "query1", + search: { + query: "", + }, + indexes: ["*"], + compute: { + aggregation: "count", + }, + groupBy: [], + storage: "online_archives", + }, + ], + formulas: [ + { + conditionalFormats: [], + cellDisplayMode: "bar", + formula: "query1", + limit: { + count: 50, + order: "desc", + }, + }, + ], + responseFormat: "scalar", + }, + ], + }, + }, + ], + }, +}; + +apiInstance + .createDashboard(params) + .then((data: v1.Dashboard) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index cdb446a2b9cf..a2b47a9be1b6 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -322,6 +322,26 @@ Feature: Dashboards And the response "widgets[0].definition.query" is equal to "" And the response "widgets[0].definition.indexes[0]" is equal to "main" + @team:DataDog/dashboards + Scenario: Create a new dashboard with logs query table widget and storage parameter + Given new "CreateDashboard" request + And body with value {"layout_type":"ordered","title":"{{ unique }} with query table widget and storage parameter","widgets":[{"definition":{"type":"query_table","requests":[{"queries":[{"data_source":"logs","name":"query1","search":{"query":""},"indexes":["*"],"compute":{"aggregation":"count"},"group_by":[],"storage":"online_archives"}],"formulas":[{"conditional_formats":[],"cell_display_mode":"bar","formula":"query1","limit":{"count":50,"order":"desc"}}],"response_format":"scalar"}]}}]} + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "query_table" + And the response "widgets[0].definition.requests[0].queries[0].data_source" is equal to "logs" + And the response "widgets[0].definition.requests[0].queries[0].storage" is equal to "online_archives" + + @team:DataDog/dashboards + Scenario: Create a new dashboard with logs_stream list_stream widget and storage parameter + Given new "CreateDashboard" request + And body with value {"layout_type": "ordered", "title": "{{ unique }} with list_stream widget","widgets": [{"definition": {"type": "list_stream","requests": [{"columns":[{"width":"auto","field":"timestamp"}],"query":{"data_source":"logs_stream","query_string":"", "storage": "hot"},"response_format":"event_list"}]}}]} + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "list_stream" + And the response "widgets[0].definition.requests[0].query.data_source" is equal to "logs_stream" + And the response "widgets[0].definition.requests[0].query.storage" is equal to "hot" + @team:DataDog/dashboards Scenario: Create a new dashboard with manage_status widget Given new "CreateDashboard" request diff --git a/packages/datadog-api-client-v1/models/FormulaAndFunctionEventQueryDefinition.ts b/packages/datadog-api-client-v1/models/FormulaAndFunctionEventQueryDefinition.ts index a1744081be78..2ccae9c8800b 100644 --- a/packages/datadog-api-client-v1/models/FormulaAndFunctionEventQueryDefinition.ts +++ b/packages/datadog-api-client-v1/models/FormulaAndFunctionEventQueryDefinition.ts @@ -38,6 +38,10 @@ export class FormulaAndFunctionEventQueryDefinition { * Search options. */ "search"?: FormulaAndFunctionEventQueryDefinitionSearch; + /** + * Option for storage location. Feature in Private Beta. + */ + "storage"?: string; /** * @ignore @@ -75,6 +79,10 @@ export class FormulaAndFunctionEventQueryDefinition { baseName: "search", type: "FormulaAndFunctionEventQueryDefinitionSearch", }, + storage: { + baseName: "storage", + type: "string", + }, }; /** diff --git a/packages/datadog-api-client-v1/models/ListStreamQuery.ts b/packages/datadog-api-client-v1/models/ListStreamQuery.ts index 975566f1a9f2..edec46a29b63 100644 --- a/packages/datadog-api-client-v1/models/ListStreamQuery.ts +++ b/packages/datadog-api-client-v1/models/ListStreamQuery.ts @@ -23,6 +23,10 @@ export class ListStreamQuery { * Widget query. */ "queryString": string; + /** + * Option for storage location. Feature in Private Beta. + */ + "storage"?: string; /** * @ignore @@ -47,6 +51,10 @@ export class ListStreamQuery { type: "string", required: true, }, + storage: { + baseName: "storage", + type: "string", + }, }; /** From 67dc404c69ae70bfc482c68c8b7f8ac357be42eb Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 08:28:15 +0000 Subject: [PATCH 19/30] Regenerate client from commit af78fdc4 of spec repo (#848) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 25 ++++ .../frozen.json | 1 + .../recording.har | 57 ++++++++ .../frozen.json | 1 + .../recording.har | 57 ++++++++ .../GetSecurityMonitoringSignal.ts | 21 +++ features/v2/security_monitoring.feature | 14 ++ features/v2/undo.json | 6 + .../apis/SecurityMonitoringApi.ts | 124 ++++++++++++++++++ packages/datadog-api-client-v2/index.ts | 1 + 11 files changed, 311 insertions(+), 4 deletions(-) create mode 100644 cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-Not-Found-response_3888721171/frozen.json create mode 100644 cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-Not-Found-response_3888721171/recording.har create mode 100644 cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-OK-response_1307184810/frozen.json create mode 100644 cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-OK-response_1307184810/recording.har create mode 100644 examples/v2/security-monitoring/GetSecurityMonitoringSignal.ts diff --git a/.apigentools-info b/.apigentools-info index cf4626d051d9..5bf1d256b468 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-22 15:10:38.455972", - "spec_repo_commit": "7f715655" + "regenerated": "2022-09-26 07:51:10.791644", + "spec_repo_commit": "af78fdc4" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-22 15:10:38.471408", - "spec_repo_commit": "7f715655" + "regenerated": "2022-09-26 07:51:10.803830", + "spec_repo_commit": "af78fdc4" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 1d5411b1cc88..85e1a8400c6d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -12863,6 +12863,31 @@ paths: cursorPath: meta.page.after limitParam: body.page.limit resultsPath: data + /api/v2/security_monitoring/signals/{signal_id}: + get: + description: Get a signal's details. + operationId: GetSecurityMonitoringSignal + parameters: + - $ref: '#/components/parameters/SignalID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityMonitoringSignal' + description: OK + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + summary: Get a signal's details + tags: + - Security Monitoring /api/v2/security_monitoring/signals/{signal_id}/assignee: patch: description: Modify the triage assignee of a security signal. diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-Not-Found-response_3888721171/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-Not-Found-response_3888721171/frozen.json new file mode 100644 index 000000000000..4edaf9f6520c --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-Not-Found-response_3888721171/frozen.json @@ -0,0 +1 @@ +"2022-09-23T14:12:23.353Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-Not-Found-response_3888721171/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-Not-Found-response_3888721171/recording.har new file mode 100644 index 000000000000..3319efff4193 --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-Not-Found-response_3888721171/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Security Monitoring/Get a signal's details returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "80586166ccca7aeabc4b8dc902a483fd", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 591, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/signals/AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptCL3QUEm3nt2" + }, + "response": { + "bodySize": 31, + "content": { + "mimeType": "application/json", + "size": 31, + "text": "{\"errors\":[\"Signal not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 669, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2022-09-23T14:12:23.357Z", + "time": 413 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-OK-response_1307184810/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-OK-response_1307184810/frozen.json new file mode 100644 index 000000000000..6a280c3b416d --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-OK-response_1307184810/frozen.json @@ -0,0 +1 @@ +"2022-09-23T14:12:23.776Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-OK-response_1307184810/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-OK-response_1307184810/recording.har new file mode 100644 index 000000000000..9e60a2ebd0dd --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-a-signal-s-details-returns-OK-response_1307184810/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Security Monitoring/Get a signal's details returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "3504b7991032a6f528fa552ddd5d2f3b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 591, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/signals/AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptMDdQUnF3QUE" + }, + "response": { + "bodySize": 54886, + "content": { + "mimeType": "application/json", + "size": 54886, + "text": "{\"data\":{\"attributes\":{\"discovery_timestamp\":1663935976788,\"searchable\":{\"title\":\"Generate a fake Signal\"},\"triggering_log_timestamp\":\"2022-09-23T12:26:16.788Z\",\"groupByValuesHash\":\"0e2-32k-1pb-1-AYNqUBVUAAB7Q6xMp4yBGgAF\",\"reducer_signal_id\":\"0e2-32k-1pb-1-AYNqUBVUAAB7Q6xMp4yBGgAF\",\"tag\":{\"source\":\"python\",\"env\":\"pcf-tealblue\",\"instance-id\":\"6161818930815280887\"},\"discovery_hour\":462204,\"gated\":{\"network\":{\"ip\":{\"list\":[\"8.8.8.8\",\"10.0.4.8\",\"127.0.0.1\"]}},\"workflow\":{\"events_matched\":200,\"rule\":{\"isDefaultRule\":false,\"defaultRuleVersion\":0,\"defaultRuleId\":null},\"high_cardinality\":{\"attributes\":[\"@trace_id\"],\"tags\":[]},\"first_seen\":\"2022-09-23T12:26:13.000Z\",\"triage\":{\"assignee\":{\"id\":-1},\"incidentIds\":[]},\"last_seen\":\"2022-09-23T12:26:41.000Z\"},\"triggeringRuleCase\":{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a>0\"},\"relatedQuery\":{\"from\":1663935673000,\"track\":\"logs\",\"viewParameters\":{\"integration_id\":\"security_monitoring\",\"integration_short_name\":\"security_investigation\"},\"to\":1663936301000,\"queries\":{\"a\":\"(source:python) ((*) OR (service:api -(source:staging)) OR (acceptance rule triggered -(does not really match much) -(neither does it)) OR (ayayay query -(does not really match much) -(neither does it)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1631884327 -(source:staging)) OR (service:TestDeleteasecurityfilterreturnsNoContentresponse1631884338 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1631884338 -(source:staging)) OR (service:TestDeleteasecurityfilterreturnsNoContentresponse1631884454 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1631884464 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1631884465 -(source:staging)) OR (service:TestDeleteasecurityfilterreturnsNoContentresponse1631884670 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1631884674 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1631884674 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1631884714 -(source:staging)) OR (service:TestDeleteasecurityfilterreturnsNoContentresponse1631884715 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1631884725 -(source:staging)) OR (service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1631886017 -(source:staging)) OR (service:TestPythonGetasecurityfilterreturnsOKresponse1631886029 -(source:staging)) OR (service:TestPythonUpdateasecurityfilterreturnsOKresponse1631886034 -(source:staging)) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632817310 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632817310 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632817311) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632820231 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632820231 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632820232) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632820436 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632820437 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632820438) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632821203 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632821205 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632821205) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632821494 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632821495 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632821495) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632824855 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632824856 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632824857) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632826434 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632826436 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632826436) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632827408 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632827409 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632827410) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632828993 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632828993 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632828994) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632832892 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632832892 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632832893) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632833158 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632833159 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632833159) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632836449 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632836451 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632836452) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839530 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839530 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839530) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839555 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839556 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839557) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839754 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839755 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839755) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632841163 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632841164 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632841165) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632842479 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632842482 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632842482) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632843068 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632843069 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632843069) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632844019 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632844020 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632844021) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632844135 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632844135 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632844135) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632846637 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632846638 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632846639) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632847599 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632847600 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632847601) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848092 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848094 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848095) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848450 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848451 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848451) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848885 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848885 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848886) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632849681 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632849683 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632849684) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632849896 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632849897 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632849898) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632851126 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632851127 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632851128) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632888517 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632888518 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632888518) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632898979 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632898980 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632898980) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632899193 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632899194 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632899194) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632902893 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632902894 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632902894) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632903483 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632903484 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632903485) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632904028 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632904028 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632904029) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632907319 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632907320 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632907320) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632907341 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632907342 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632907342) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632908400 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632908401 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632908402) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632909893 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632909895 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632909896) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632910740 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632910741 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632910742) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632913811 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632913813 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632913814) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632918181 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632918181 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632918182) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632919352 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632919352 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632919353) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632919567 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632919568 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632919568) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632921868 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632921868 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632921869) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632922202 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632922203 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632922203) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632928250 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632928250 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632928251) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632933845 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632933846 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632933847) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632974965 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632974966 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632974966) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632986086 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632986087 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632986087) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632989757 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632989758 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632989758) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632997311 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632997312 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632997312) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633000142 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633000144 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633000145) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633003795 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633003796 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633003797) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633004068 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633004069 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633004069) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633006704 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633006704 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633006705) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633007542 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633007542 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633007543) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633011104 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633011105 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633011105) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633011244 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633011246 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633011247) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633015449 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633015451 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633015452) OR (service:TestRubyGetasecurityfilterreturnsOKresponse1634150224 -(source:staging)) OR (service:TestPythonGetasecurityfilterreturnsOKresponse1635496812 -(source:staging)) OR (service:TestGoGetasecurityfilterreturnsOKresponse1636410254 -(source:staging)) OR (service:TestCreateasecurityfilterreturnsOKresponse1637063344 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1637063346 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1637063347) OR (service:TestCreateasecurityfilterreturnsOKresponse1637070528 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1637070533 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1637070535) OR (service:TestCreateasecurityfilterreturnsOKresponse1637077967 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1637077969 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1637077970) OR (service:TestCreateasecurityfilterreturnsOKresponse1637078478 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1637078481 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1637078482) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1637089241 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1620751633 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1620751634) OR (service:TestCreateasecurityfilterreturnsOKresponse1637141213 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1637141215 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1637141217) OR (service:TestRubyGetasecurityfilterreturnsOKresponse1637834808 -(source:staging)) OR (service:TestPythonGetasecurityfilterreturnsOKresponse1638987050 -(source:staging)) OR (service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1638987054 -(source:staging)) OR (service:TestPythonUpdateasecurityfilterreturnsOKresponse1638987055 -(source:staging)) OR (service:TestPythonCreateasecurityfilterreturnsOKresponse1638987057 -(source:staging)) OR (service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1639574360 -(source:staging)) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1640111630 -(source:staging)) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1640112776 -(source:staging)) OR (service:TestCreateasecurityfilterreturnsOKresponse1640112926 -(source:staging)) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1641598933 -(source:staging)) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1642578134 -(source:staging)) OR (service:TestExampleGetasecurityfilterreturnsOKresponse1642733138 -(source:staging)) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1642756664 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1642756664 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1642756664 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1642756664 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1643209589) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1643950965) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1644339764 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1644382966 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1644656566 -(source:staging)) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1644685366 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1645102964) OR (service:ExampleGetasecurityfilterreturnsOKresponse1645131764 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1645534965) OR (service:ExampleGetasecurityfilterreturnsOKresponse1645664565 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1647162167) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1647651765 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1647954164) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1648170165 -(source:staging)) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1648270965 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1648314166 -(source:staging)) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1648501364 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1648501364) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1648587764) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1648818166 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1648832565 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1648990964) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1649120564) OR (service:ExampleGetasecurityfilterreturnsOKresponse1649192564 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1649667764 -(source:staging)) OR (service:TestDeleteasecurityfilterreturnsNoContentresponse1649928918 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1650243764 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1650358964) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1650531764) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1651410164) OR (service:ExampleGetasecurityfilterreturnsOKresponse1651597364 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1651654964 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651867320 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651912576 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651915972 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651943585 -(source:staging)) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1651997988 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651997988 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1651997989 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1651997990) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1652008989 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1656001148 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1656001148) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1656001150 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1657253948 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1657469948 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1657599548) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1657887548) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1658175548) OR (first query -(does not really match much) -(neither does it)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1658636349) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1658909949) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1659140350 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1660119548 -(source:staging)))\"},\"query\":\"(source:python) ((*) OR (service:api -(source:staging)) OR (acceptance rule triggered -(does not really match much) -(neither does it)) OR (ayayay query -(does not really match much) -(neither does it)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1631884327 -(source:staging)) OR (service:TestDeleteasecurityfilterreturnsNoContentresponse1631884338 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1631884338 -(source:staging)) OR (service:TestDeleteasecurityfilterreturnsNoContentresponse1631884454 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1631884464 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1631884465 -(source:staging)) OR (service:TestDeleteasecurityfilterreturnsNoContentresponse1631884670 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1631884674 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1631884674 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1631884714 -(source:staging)) OR (service:TestDeleteasecurityfilterreturnsNoContentresponse1631884715 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1631884725 -(source:staging)) OR (service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1631886017 -(source:staging)) OR (service:TestPythonGetasecurityfilterreturnsOKresponse1631886029 -(source:staging)) OR (service:TestPythonUpdateasecurityfilterreturnsOKresponse1631886034 -(source:staging)) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632817310 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632817310 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632817311) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632820231 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632820231 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632820232) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632820436 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632820437 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632820438) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632821203 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632821205 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632821205) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632821494 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632821495 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632821495) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632824855 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632824856 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632824857) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632826434 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632826436 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632826436) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632827408 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632827409 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632827410) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632828993 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632828993 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632828994) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632832892 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632832892 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632832893) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632833158 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632833159 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632833159) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632836449 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632836451 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632836452) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839530 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839530 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839530) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839555 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839556 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839557) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839754 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839755 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839755) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632841163 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632841164 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632841165) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632842479 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632842482 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632842482) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632843068 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632843069 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632843069) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632844019 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632844020 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632844021) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632844135 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632844135 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632844135) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632846637 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632846638 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632846639) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632847599 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632847600 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632847601) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848092 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848094 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848095) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848450 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848451 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848451) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848885 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848885 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848886) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632849681 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632849683 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632849684) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632849896 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632849897 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632849898) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632851126 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632851127 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632851128) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632888517 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632888518 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632888518) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632898979 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632898980 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632898980) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632899193 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632899194 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632899194) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632902893 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632902894 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632902894) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632903483 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632903484 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632903485) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632904028 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632904028 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632904029) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632907319 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632907320 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632907320) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632907341 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632907342 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632907342) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632908400 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632908401 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632908402) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632909893 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632909895 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632909896) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632910740 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632910741 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632910742) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632913811 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632913813 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632913814) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632918181 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632918181 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632918182) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632919352 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632919352 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632919353) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632919567 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632919568 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632919568) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632921868 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632921868 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632921869) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632922202 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632922203 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632922203) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632928250 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632928250 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632928251) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632933845 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632933846 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632933847) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632974965 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632974966 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632974966) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632986086 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632986087 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632986087) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632989757 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632989758 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632989758) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632997311 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1632997312 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632997312) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633000142 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633000144 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633000145) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633003795 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633003796 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633003797) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633004068 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633004069 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633004069) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633006704 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633006704 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633006705) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633007542 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633007542 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633007543) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633011104 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633011105 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633011105) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633011244 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633011246 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633011247) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633015449 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1633015451 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633015452) OR (service:TestRubyGetasecurityfilterreturnsOKresponse1634150224 -(source:staging)) OR (service:TestPythonGetasecurityfilterreturnsOKresponse1635496812 -(source:staging)) OR (service:TestGoGetasecurityfilterreturnsOKresponse1636410254 -(source:staging)) OR (service:TestCreateasecurityfilterreturnsOKresponse1637063344 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1637063346 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1637063347) OR (service:TestCreateasecurityfilterreturnsOKresponse1637070528 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1637070533 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1637070535) OR (service:TestCreateasecurityfilterreturnsOKresponse1637077967 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1637077969 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1637077970) OR (service:TestCreateasecurityfilterreturnsOKresponse1637078478 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1637078481 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1637078482) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1637089241 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1620751633 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1620751634) OR (service:TestCreateasecurityfilterreturnsOKresponse1637141213 -(source:staging)) OR (service:TestGetasecurityfilterreturnsOKresponse1637141215 -(source:staging)) OR (service:TestUpdateasecurityfilterreturnsOKresponse1637141217) OR (service:TestRubyGetasecurityfilterreturnsOKresponse1637834808 -(source:staging)) OR (service:TestPythonGetasecurityfilterreturnsOKresponse1638987050 -(source:staging)) OR (service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1638987054 -(source:staging)) OR (service:TestPythonUpdateasecurityfilterreturnsOKresponse1638987055 -(source:staging)) OR (service:TestPythonCreateasecurityfilterreturnsOKresponse1638987057 -(source:staging)) OR (service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1639574360 -(source:staging)) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1640111630 -(source:staging)) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1640112776 -(source:staging)) OR (service:TestCreateasecurityfilterreturnsOKresponse1640112926 -(source:staging)) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1641598933 -(source:staging)) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1642578134 -(source:staging)) OR (service:TestExampleGetasecurityfilterreturnsOKresponse1642733138 -(source:staging)) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1642756664 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1642756664 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1642756664 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1642756664 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1643209589) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1643950965) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1644339764 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1644382966 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1644656566 -(source:staging)) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1644685366 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1645102964) OR (service:ExampleGetasecurityfilterreturnsOKresponse1645131764 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1645534965) OR (service:ExampleGetasecurityfilterreturnsOKresponse1645664565 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1647162167) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1647651765 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1647954164) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1648170165 -(source:staging)) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1648270965 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1648314166 -(source:staging)) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1648501364 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1648501364) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1648587764) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1648818166 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1648832565 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1648990964) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1649120564) OR (service:ExampleGetasecurityfilterreturnsOKresponse1649192564 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1649667764 -(source:staging)) OR (service:TestDeleteasecurityfilterreturnsNoContentresponse1649928918 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1650243764 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1650358964) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1650531764) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1651410164) OR (service:ExampleGetasecurityfilterreturnsOKresponse1651597364 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1651654964 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651867320 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651912576 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651915972 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651943585 -(source:staging)) OR (service:TestTypescriptCreateasecurityfilterreturnsOKresponse1651997988 -(source:staging)) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651997988 -(source:staging)) OR (service:TestTypescriptGetasecurityfilterreturnsOKresponse1651997989 -(source:staging)) OR (service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1651997990) OR (service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1652008989 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1656001148 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1656001148) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1656001150 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1657253948 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1657469948 -(source:staging)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1657599548) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1657887548) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1658175548) OR (first query -(does not really match much) -(neither does it)) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1658636349) OR (service:ExampleUpdateasecurityfilterreturnsOKresponse1658909949) OR (service:ExampleCreateasecurityfilterreturnsOKresponse1659140350 -(source:staging)) OR (service:ExampleGetasecurityfilterreturnsOKresponse1660119548 -(source:staging)))\"},\"samples\":[{\"eventId\":\"AQAAAYNqUHKuyVb_mQAAAABBWU5xVUhrY0FBQUVSQy1nN2N2S1VBQUg\",\"content\":{\"status\":\"info\",\"service\":\"python-sample-app-tealblue\",\"tags\":[\"application_name:python-sample-app-tealblue\",\"application_id:dc251c1e-8302-4a43-abdf-ceebb92ca65d\",\"service:python-sample-app-tealblue\",\"cf_instance_ip:10.0.4.8\",\"foo:bar_test:value_tag1:value1_tag2:value2_teeeeeeest:compuuuuuuuuuuute\",\"container_id:0b163cd0-865c-4c88-4154-f690\",\"instance_index:3\",\"uri:python-sample-app-tealblue.apps.tealblue.cf-app.com\",\"source:python\",\"space_name:space-1\",\"bosh_address:10.0.4.8\",\"bosh_az:us-central1-f\",\"bosh_deployment:cf-1d7968619a3587a78a93\",\"bosh_id:c190d27b-0292-44b8-b094-84ff511768ba\",\"bosh_index:0\",\"bosh_ip:10.0.4.8\",\"bosh_job:compute\",\"bosh_name:compute\",\"cf-1d7968619a3587a78a93\",\"cf-1d7968619a3587a78a93-compute\",\"cloudfoundry\",\"compute\",\"created_at:2022-09-19t07:20:02z\",\"deployment:cf-1d7968619a3587a78a93\",\"director:p-bosh\",\"id:c190d27b-0292-44b8-b094-84ff511768ba\",\"index:0\",\"index:c190d27b-0292-44b8-b094-84ff511768ba\",\"instance-id:6161818930815280887\",\"instance-type:n1-highmem-2\",\"instance_group:compute\",\"internal-hostname:vm-92e16ba4-36a5-43d2-5e94-f14239018e5c.c.cf-security-triage-dist-secur.internal\",\"ip:10.0.4.8\",\"job:compute\",\"name:compute/c190d27b-0292-44b8-b094-84ff511768ba\",\"numeric_project_id:734559154119\",\"p-bosh\",\"p-bosh-cf-1d7968619a3587a78a93\",\"p-bosh-cf-1d7968619a3587a78a93-compute\",\"pcf-tealblue\",\"project:cf-security-triage-dist-secur\",\"user_data:_server_:_name_:_vm-92e16ba4-36a5-43d2-5e94-f14239018e5c_registry_:_endpoint_:_://:_:0_dns_:_nameserver_:_8.8.8.8\",\"zone:us-central1-f\",\"env:pcf-tealblue\",\"version:1.0.0\"],\"timestamp\":\"2022-09-23T12:26:40.686Z\",\"ingest_size_in_bytes\":729,\"trace_id\":\"0\",\"custom\":{\"network\":{\"ip\":{\"list\":[\"8.8.8.8\",\"10.0.4.8\",\"127.0.0.1\"]}},\"process\":{\"name\":\"werkzeug\"},\"timestamp\":1663936000686,\"dd\":{\"service\":\"python-sample-app-tealblue\",\"span_id\":\"0\"},\"filename\":\"_internal.py\",\"lineno\":224.0,\"levelname\":\"INFO\"},\"source\":\"python\",\"host\":\"compute-0-c190d27b-0292-44b8-b094-84ff511768ba\",\"tiebreaker\":-917045351,\"host_id\":8616828918,\"message\":\"2022-09-23 12:26:40,686 INFO [werkzeug] [_internal.py:224] [dd.service=python-sample-app-tealblue dd.env=pcf-tealblue dd.version=1.0.0 dd.trace_id=0 dd.span_id=0] - 127.0.0.1 - - [23/Sep/2022 12:26:40] \\\"GET / HTTP/1.1\\\" 200 -\"},\"queryIndex\":0,\"trackKey\":{\"orgId\":321813,\"type\":\"logs\"},\"id\":\"AYNqUHkcAAAERC-g7cvKUAAH\"}],\"queries\":[{\"distinctFields\":[],\"aggregationDetails\":{\"eventsCount\":200,\"distinctValues\":[],\"value\":200.0},\"name\":\"\",\"metric\":null,\"aggregation\":\"count\",\"query\":\"source:python\",\"groupByPaths\":[]}]},\"message\":\"%%%\\nGenerate a fake Signal\\n%%%\",\"event_tracker_id\":\"AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptMDdQUnF3QUE\",\"severity\":0,\"service\":[\"python-sample-app-tealblue\"],\"event_id\":\"AYNqUBVUAAB2Awzm07PRqwAA\",\"custom\":{\"entities\":[\"@network.ip.list:8.8.8.8\",\"@network.ip.list:10.0.4.8\",\"@network.ip.list:127.0.0.1\",\"host:compute-0-c190d27b-0292-44b8-b094-84ff511768ba\"],\"title\":\"Generate a fake Signal\",\"workflow\":{\"triage\":{\"assignee\":{\"name\":\"Unassigned\"},\"state\":\"open\"},\"rule\":{\"detectionMethod\":\"threshold\",\"version\":1,\"type\":\"Log Detection\",\"name\":\"Generate a fake Signal\",\"id\":\"0e2-32k-1pb\"}}},\"version\":53,\"size_in_bytes\":0,\"status\":\"info\",\"tags\":[\"application_id:dc251c1e-8302-4a43-abdf-ceebb92ca65d\",\"ip:10.0.4.8\",\"container_id:efdf8d23-8c83-42f6-6d01-7a0a\",\"source:python\",\"container_id:0bb93650-07b3-4aad-5ad6-6265\",\"id:c190d27b-0292-44b8-b094-84ff511768ba\",\"numeric_project_id:734559154119\",\"bosh_deployment:cf-1d7968619a3587a78a93\",\"job:compute\",\"bosh_id:c190d27b-0292-44b8-b094-84ff511768ba\",\"bosh_az:us-central1-f\",\"foo:bar_test:value_tag1:value1_tag2:value2_teeeeeeest:compuuuuuuuuuuute\",\"instance_index:3\",\"user_data:_server_:_name_:_vm-92e16ba4-36a5-43d2-5e94-f14239018e5c_registry_:_endpoint_:_://:_:0_dns_:_nameserver_:_8.8.8.8\",\"uri:python-sample-app-tealblue.apps.tealblue.cf-app.com\",\"instance_index:2\",\"index:0\",\"name:compute/c190d27b-0292-44b8-b094-84ff511768ba\",\"application_name:python-sample-app-tealblue\",\"version:1.0.0\",\"created_at:2022-09-19t07:20:02z\",\"index:c190d27b-0292-44b8-b094-84ff511768ba\",\"bosh_address:10.0.4.8\",\"instance_index:1\",\"service:python-sample-app-tealblue\",\"instance_index:0\",\"deployment:cf-1d7968619a3587a78a93\",\"instance-id:6161818930815280887\",\"env:pcf-tealblue\",\"instance-type:n1-highmem-2\",\"zone:us-central1-f\",\"internal-hostname:vm-92e16ba4-36a5-43d2-5e94-f14239018e5c.c.cf-security-triage-dist-secur.internal\",\"bosh_index:0\",\"bosh_job:compute\",\"bosh_ip:10.0.4.8\",\"project:cf-security-triage-dist-secur\",\"bosh_name:compute\",\"cf_instance_ip:10.0.4.8\",\"director:p-bosh\",\"container_id:0b163cd0-865c-4c88-4154-f690\",\"space_name:space-1\",\"instance_group:compute\",\"container_id:bd53178f-e250-443a-6b13-191e\"],\"timestamp\":\"2022-09-23T12:26:16.788Z\",\"datadog.index\":\"signal\",\"host\":\"compute-0-c190d27b-0292-44b8-b094-84ff511768ba\",\"random_draw\":0.6713430866837291,\"tiebreaker\":-471146625},\"type\":\"signal\",\"id\":\"AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptMDdQUnF3QUE\"}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 629, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-23T14:12:23.780Z", + "time": 594 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/security-monitoring/GetSecurityMonitoringSignal.ts b/examples/v2/security-monitoring/GetSecurityMonitoringSignal.ts new file mode 100644 index 000000000000..605ca774c026 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityMonitoringSignal.ts @@ -0,0 +1,21 @@ +/** + * Get a signal's details returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +const params: v2.SecurityMonitoringApiGetSecurityMonitoringSignalRequest = { + signalId: "AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptMDdQUnF3QUE", +}; + +apiInstance + .getSecurityMonitoringSignal(params) + .then((data: v2.SecurityMonitoringSignal) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index b08bad9ca1f4..f3fd84625327 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -219,6 +219,20 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @replay-only @team:DataDog/k9-cloud-security-platform + Scenario: Get a signal's details returns "Not Found" response + Given new "GetSecurityMonitoringSignal" request + And request contains "signal_id" parameter with value "AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptCL3QUEm3nt2" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/k9-cloud-security-platform + Scenario: Get a signal's details returns "OK" response + Given new "GetSecurityMonitoringSignal" request + And request contains "signal_id" parameter with value "AQAAAYNqUBVU4-rffwAAAABBWU5xVUJWVUFBQjJBd3ptMDdQUnF3QUE" + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-cloud-security-platform Scenario: Get all security filters returns "OK" response Given new "ListSecurityFilters" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 97b84af6f7dd..ab8314e7e7dc 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -752,6 +752,12 @@ "type": "safe" } }, + "GetSecurityMonitoringSignal": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "EditSecurityMonitoringSignalAssignee": { "tag": "Security Monitoring", "undo": { diff --git a/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts index af181d80f4dc..3b0b00c40d5d 100644 --- a/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts +++ b/packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts @@ -462,6 +462,44 @@ export class SecurityMonitoringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getSecurityMonitoringSignal( + signalId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'signalId' is not null or undefined + if (signalId === null || signalId === undefined) { + throw new RequiredError( + "Required parameter signalId was null or undefined when calling getSecurityMonitoringSignal." + ); + } + + // Path Params + const localVarPath = + "/api/v2/security_monitoring/signals/{signal_id}".replace( + "{" + "signal_id" + "}", + encodeURIComponent(String(signalId)) + ); + + // Make Request Context + const requestContext = getServer( + _config, + "v2.SecurityMonitoringApi.getSecurityMonitoringSignal" + ).makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listSecurityFilters( _options?: Configuration ): Promise { @@ -1307,6 +1345,63 @@ export class SecurityMonitoringApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getSecurityMonitoringSignal + * @throws ApiException if the response code was not in [200, 299] + */ + public async getSecurityMonitoringSignal( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode == 200) { + const body: SecurityMonitoringSignal = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringSignal" + ) as SecurityMonitoringSignal; + return body; + } + if (response.httpStatusCode == 404 || response.httpStatusCode == 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SecurityMonitoringSignal = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SecurityMonitoringSignal", + "" + ) as SecurityMonitoringSignal; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1762,6 +1857,14 @@ export interface SecurityMonitoringApiGetSecurityMonitoringRuleRequest { ruleId: string; } +export interface SecurityMonitoringApiGetSecurityMonitoringSignalRequest { + /** + * The ID of the signal. + * @type string + */ + signalId: string; +} + export interface SecurityMonitoringApiListSecurityMonitoringRulesRequest { /** * Size for a given page. @@ -2066,6 +2169,27 @@ export class SecurityMonitoringApi { }); } + /** + * Get a signal's details. + * @param param The request object + */ + public getSecurityMonitoringSignal( + param: SecurityMonitoringApiGetSecurityMonitoringSignalRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.getSecurityMonitoringSignal(param.signalId, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getSecurityMonitoringSignal( + responseContext + ); + }); + }); + } + /** * Get the list of configured security filters with their definitions. * @param param The request object diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index eb5325ded652..d4fba2d580a5 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -179,6 +179,7 @@ export { SecurityMonitoringApiEditSecurityMonitoringSignalStateRequest, SecurityMonitoringApiGetSecurityFilterRequest, SecurityMonitoringApiGetSecurityMonitoringRuleRequest, + SecurityMonitoringApiGetSecurityMonitoringSignalRequest, SecurityMonitoringApiListSecurityMonitoringRulesRequest, SecurityMonitoringApiListSecurityMonitoringSignalsRequest, SecurityMonitoringApiSearchSecurityMonitoringSignalsRequest, From 6a2cf7284e7a94f8c8cb8a24e2b67c0b68851a5d Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 09:42:00 +0000 Subject: [PATCH 20/30] Regenerate client from commit db0d8d65 of spec repo (#849) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +-- .../frozen.json | 1 - .../recording.har | 67 ------------------- 3 files changed, 4 insertions(+), 72 deletions(-) delete mode 100644 cassettes/v2/RUM_2896677143/Aggregate-RUM-events-returns-OK-response_3572346207/frozen.json delete mode 100644 cassettes/v2/RUM_2896677143/Aggregate-RUM-events-returns-OK-response_3572346207/recording.har diff --git a/.apigentools-info b/.apigentools-info index 5bf1d256b468..d6d8c75a6123 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-26 07:51:10.791644", - "spec_repo_commit": "af78fdc4" + "regenerated": "2022-09-26 08:57:11.591748", + "spec_repo_commit": "db0d8d65" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-26 07:51:10.803830", - "spec_repo_commit": "af78fdc4" + "regenerated": "2022-09-26 08:57:11.603755", + "spec_repo_commit": "db0d8d65" } } } \ No newline at end of file diff --git a/cassettes/v2/RUM_2896677143/Aggregate-RUM-events-returns-OK-response_3572346207/frozen.json b/cassettes/v2/RUM_2896677143/Aggregate-RUM-events-returns-OK-response_3572346207/frozen.json deleted file mode 100644 index ad448280ae2b..000000000000 --- a/cassettes/v2/RUM_2896677143/Aggregate-RUM-events-returns-OK-response_3572346207/frozen.json +++ /dev/null @@ -1 +0,0 @@ -"2022-03-29T08:59:44.790Z" diff --git a/cassettes/v2/RUM_2896677143/Aggregate-RUM-events-returns-OK-response_3572346207/recording.har b/cassettes/v2/RUM_2896677143/Aggregate-RUM-events-returns-OK-response_3572346207/recording.har deleted file mode 100644 index bf5333134766..000000000000 --- a/cassettes/v2/RUM_2896677143/Aggregate-RUM-events-returns-OK-response_3572346207/recording.har +++ /dev/null @@ -1,67 +0,0 @@ -{ - "log": { - "_recordingName": "RUM/Aggregate RUM events. returns \"OK\" response", - "creator": { - "comment": "persister:fs", - "name": "Polly.JS", - "version": "6.0.4" - }, - "entries": [ - { - "_id": "30d257bcd9ec7fde0a399fe71ad14e77", - "_order": 0, - "cache": {}, - "request": { - "bodySize": 278, - "cookies": [], - "headers": [ - { - "_fromType": "array", - "name": "accept", - "value": "application/json" - }, - { - "_fromType": "array", - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 576, - "httpVersion": "HTTP/1.1", - "method": "POST", - "postData": { - "mimeType": "application/json", - "params": [], - "text": "{\"compute\":[{\"aggregation\":\"pc90\",\"metric\":\"@view.time_spent\",\"type\":\"total\"}],\"filter\":{\"from\":\"now-15m\",\"query\":\"@type:view AND @session.type:user\",\"to\":\"now\"},\"group_by\":[{\"facet\":\"@view.time_spent\",\"limit\":10,\"total\":false}],\"options\":{\"timezone\":\"GMT\"},\"page\":{\"limit\":25}}" - }, - "queryString": [], - "url": "https://api.datadoghq.com/api/v2/rum/analytics/aggregate" - }, - "response": { - "bodySize": 177, - "content": { - "mimeType": "application/json", - "size": 177, - "text": "{\"meta\":{\"status\":\"done\",\"request_id\":\"pddv1ChZiX1d1RWNfM1JuaURhSkJ6elFsRHpnIi0KHQJFlSKZaC6T1BR15cquEEJdzvJ8iKfJO5Kr37vkEgyJYfau6iiq_M5ftbo\",\"elapsed\":0},\"data\":{\"buckets\":[]}}\n" - }, - "cookies": [], - "headers": [ - { - "name": "content-type", - "value": "application/json" - } - ], - "headersSize": 593, - "httpVersion": "HTTP/1.1", - "redirectURL": "", - "status": 200, - "statusText": "OK" - }, - "startedDateTime": "2022-03-29T08:59:44.806Z", - "time": 309 - } - ], - "pages": [], - "version": "1.2" - } -} From c6326e71a8711d1bf3e4e6612da7aa55d13e757b Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 11:32:34 +0000 Subject: [PATCH 21/30] Regenerate client from commit 24936e30 of spec repo (#841) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 401 ++++++++++++------ .../frozen.json | 2 +- .../recording.har | 18 +- .../frozen.json | 2 +- .../recording.har | 30 +- .../frozen.json | 1 + .../recording.har | 284 +++++++++++++ .../CreateSecurityMonitoringRule.ts | 1 + .../CreateSecurityMonitoringRule_914562040.ts | 60 +++ features/v2/given.json | 12 + features/v2/security_monitoring.feature | 11 +- packages/datadog-api-client-v2/index.ts | 8 +- .../models/ObjectSerializer.ts | 33 +- .../SecurityMonitoringRuleCreatePayload.ts | 120 +----- .../models/SecurityMonitoringRuleQuery.ts | 87 +--- .../SecurityMonitoringRuleQueryAggregation.ts | 4 +- .../models/SecurityMonitoringRuleTypeRead.ts | 2 + ...curityMonitoringSignalRuleCreatePayload.ts | 124 ++++++ .../SecurityMonitoringSignalRuleQuery.ts | 83 ++++ ...SecurityMonitoringSignalRuleQueryCreate.ts | 84 ++++ .../SecurityMonitoringSignalRuleTypeCreate.ts | 8 + ...rityMonitoringStandardRuleCreatePayload.ts | 124 ++++++ .../SecurityMonitoringStandardRuleQuery.ts | 91 ++++ ...urityMonitoringStandardRuleQueryCreate.ts} | 4 +- 25 files changed, 1240 insertions(+), 362 deletions(-) create mode 100644 cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/frozen.json create mode 100644 cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/recording.har create mode 100644 examples/v2/security-monitoring/CreateSecurityMonitoringRule_914562040.ts create mode 100644 packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleCreatePayload.ts create mode 100644 packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQuery.ts create mode 100644 packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQueryCreate.ts create mode 100644 packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleTypeCreate.ts create mode 100644 packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleCreatePayload.ts create mode 100644 packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQuery.ts rename packages/datadog-api-client-v2/models/{SecurityMonitoringRuleQueryCreate.ts => SecurityMonitoringStandardRuleQueryCreate.ts} (93%) diff --git a/.apigentools-info b/.apigentools-info index d6d8c75a6123..279e662f39b3 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-26 08:57:11.591748", - "spec_repo_commit": "db0d8d65" + "regenerated": "2022-09-26 09:51:31.902097", + "spec_repo_commit": "24936e30" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-26 08:57:11.603755", - "spec_repo_commit": "db0d8d65" + "regenerated": "2022-09-26 09:51:31.917551", + "spec_repo_commit": "24936e30" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 85e1a8400c6d..a7ff6a4a7b3a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -6994,62 +6994,9 @@ components: type: object SecurityMonitoringRuleCreatePayload: description: Create a new rule. - properties: - cases: - description: Cases for generating signals. - example: [] - items: - $ref: '#/components/schemas/SecurityMonitoringRuleCaseCreate' - type: array - filters: - description: Additional queries to filter matched events before they are - processed. - items: - $ref: '#/components/schemas/SecurityMonitoringFilter' - type: array - hasExtendedTitle: - description: Whether the notifications include the triggering group-by values - in their title. - example: true - type: boolean - isEnabled: - description: Whether the rule is enabled. - example: true - type: boolean - message: - description: Message for generated signals. - example: '' - type: string - name: - description: The name of the rule. - example: My security monitoring rule. - type: string - options: - $ref: '#/components/schemas/SecurityMonitoringRuleOptions' - queries: - description: Queries for selecting logs which are part of the rule. - example: [] - items: - $ref: '#/components/schemas/SecurityMonitoringRuleQueryCreate' - type: array - tags: - description: Tags for generated signals. - example: - - env:prod - - team:security - items: - description: Tag. - type: string - type: array - type: - $ref: '#/components/schemas/SecurityMonitoringRuleTypeCreate' - required: - - name - - isEnabled - - queries - - options - - cases - - message + oneOf: + - $ref: '#/components/schemas/SecurityMonitoringStandardRuleCreatePayload' + - $ref: '#/components/schemas/SecurityMonitoringSignalRuleCreatePayload' type: object SecurityMonitoringRuleDecreaseCriticalityBasedOnEnv: description: 'If true, signals in non-production environments have a lower severity @@ -7274,39 +7221,9 @@ components: type: object SecurityMonitoringRuleQuery: description: Query for matching rule. - properties: - aggregation: - $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' - distinctFields: - description: Field for which the cardinality is measured. Sent as an array. - items: - description: Field. - type: string - type: array - groupByFields: - description: Fields to group by. - items: - description: Field. - type: string - type: array - metric: - description: 'The target field to aggregate over when using the sum or max - - aggregations.' - type: string - metrics: - description: Group of target fields to aggregate over when using the new - value aggregations. - items: - description: Field. - type: string - type: array - name: - description: Name of the query. - type: string - query: - description: Query to run on logs. - type: string + oneOf: + - $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' + - $ref: '#/components/schemas/SecurityMonitoringSignalRuleQuery' type: object SecurityMonitoringRuleQueryAggregation: description: The aggregation type. @@ -7317,6 +7234,7 @@ components: - max - new_value - geo_data + - event_count type: string x-enum-varnames: - COUNT @@ -7325,45 +7243,7 @@ components: - MAX - NEW_VALUE - GEO_DATA - SecurityMonitoringRuleQueryCreate: - description: Query for matching rule. - properties: - aggregation: - $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' - distinctFields: - description: Field for which the cardinality is measured. Sent as an array. - items: - description: Field. - type: string - type: array - groupByFields: - description: Fields to group by. - items: - description: Field. - type: string - type: array - metric: - description: 'The target field to aggregate over when using the sum or max - - aggregations.' - type: string - metrics: - description: Group of target fields to aggregate over when using the new - value aggregations. - items: - description: Field. - type: string - type: array - name: - description: Name of the query. - type: string - query: - description: Query to run on logs. - example: a > 3 - type: string - required: - - query - type: object + - EVENT_COUNT SecurityMonitoringRuleResponse: description: Rule. properties: @@ -7460,12 +7340,14 @@ components: description: The rule type. enum: - log_detection + - signal_correlation - infrastructure_configuration - workload_security - cloud_configuration type: string x-enum-varnames: - LOG_DETECTION + - SIGNAL_CORRELATION - INFRASTRUCTURE_CONFIGURATION - WORKLOAD_SECURITY - CLOUD_CONFIGURATION @@ -7691,6 +7573,135 @@ components: maximum: 1000 type: integer type: object + SecurityMonitoringSignalRuleCreatePayload: + description: Create a new signal correlation rule. + properties: + cases: + description: Cases for generating signals. + example: [] + items: + $ref: '#/components/schemas/SecurityMonitoringRuleCaseCreate' + type: array + filters: + description: Additional queries to filter matched events before they are + processed. + items: + $ref: '#/components/schemas/SecurityMonitoringFilter' + type: array + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + example: true + type: boolean + isEnabled: + description: Whether the rule is enabled. + example: true + type: boolean + message: + description: Message for generated signals. + example: '' + type: string + name: + description: The name of the rule. + example: My security monitoring rule. + type: string + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting signals which are part of the rule. + example: [] + items: + $ref: '#/components/schemas/SecurityMonitoringSignalRuleQueryCreate' + type: array + tags: + description: Tags for generated signals. + example: + - env:prod + - team:security + items: + description: Tag. + type: string + type: array + type: + $ref: '#/components/schemas/SecurityMonitoringSignalRuleTypeCreate' + required: + - name + - isEnabled + - queries + - options + - cases + - message + type: object + SecurityMonitoringSignalRuleQuery: + description: Query for matching rule on signals + properties: + aggregation: + $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' + correlatedByFields: + description: Fields to group by. + items: + description: Field. + type: string + type: array + correlatedQueryIndex: + description: Index of the rule query used to retrieve the correlated field. + format: int32 + maximum: 9 + type: integer + metrics: + description: Group of target fields to aggregate over when using the new + value aggregations. + items: + description: Field. + type: string + type: array + name: + description: Name of the query. + type: string + ruleId: + description: Rule ID to match on signals. + type: string + type: object + SecurityMonitoringSignalRuleQueryCreate: + description: Query for matching rule on signals + properties: + aggregation: + $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' + correlatedByFields: + description: Fields to group by. + items: + description: Field. + type: string + type: array + correlatedQueryIndex: + description: Index of the rule query used to retrieve the correlated field. + format: int32 + maximum: 9 + type: integer + metrics: + description: Group of target fields to aggregate over when using the new + value aggregations. + items: + description: Field. + type: string + type: array + name: + description: Name of the query. + type: string + ruleId: + description: Rule ID to match on signals. + example: d3f-ru1-e1d + type: string + required: + - ruleId + type: object + SecurityMonitoringSignalRuleTypeCreate: + description: The rule type. + enum: + - signal_correlation + type: string + x-enum-varnames: + - SIGNAL_CORRELATION SecurityMonitoringSignalState: description: The new triage state of the signal. enum: @@ -7847,6 +7858,140 @@ components: x-enum-varnames: - TIMESTAMP_ASCENDING - TIMESTAMP_DESCENDING + SecurityMonitoringStandardRuleCreatePayload: + description: Create a new rule. + properties: + cases: + description: Cases for generating signals. + example: [] + items: + $ref: '#/components/schemas/SecurityMonitoringRuleCaseCreate' + type: array + filters: + description: Additional queries to filter matched events before they are + processed. + items: + $ref: '#/components/schemas/SecurityMonitoringFilter' + type: array + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + example: true + type: boolean + isEnabled: + description: Whether the rule is enabled. + example: true + type: boolean + message: + description: Message for generated signals. + example: '' + type: string + name: + description: The name of the rule. + example: My security monitoring rule. + type: string + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting logs which are part of the rule. + example: [] + items: + $ref: '#/components/schemas/SecurityMonitoringStandardRuleQueryCreate' + type: array + tags: + description: Tags for generated signals. + example: + - env:prod + - team:security + items: + description: Tag. + type: string + type: array + type: + $ref: '#/components/schemas/SecurityMonitoringRuleTypeCreate' + required: + - name + - isEnabled + - queries + - options + - cases + - message + type: object + SecurityMonitoringStandardRuleQuery: + description: Query for matching rule. + properties: + aggregation: + $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' + distinctFields: + description: Field for which the cardinality is measured. Sent as an array. + items: + description: Field. + type: string + type: array + groupByFields: + description: Fields to group by. + items: + description: Field. + type: string + type: array + metric: + description: 'The target field to aggregate over when using the sum or max + + aggregations.' + type: string + metrics: + description: Group of target fields to aggregate over when using the new + value aggregations. + items: + description: Field. + type: string + type: array + name: + description: Name of the query. + type: string + query: + description: Query to run on logs. + type: string + type: object + SecurityMonitoringStandardRuleQueryCreate: + description: Query for matching rule. + properties: + aggregation: + $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' + distinctFields: + description: Field for which the cardinality is measured. Sent as an array. + items: + description: Field. + type: string + type: array + groupByFields: + description: Fields to group by. + items: + description: Field. + type: string + type: array + metric: + description: 'The target field to aggregate over when using the sum or max + + aggregations.' + type: string + metrics: + description: Group of target fields to aggregate over when using the new + value aggregations. + items: + description: Field. + type: string + type: array + name: + description: Name of the query. + type: string + query: + description: Query to run on logs. + example: a > 3 + type: string + required: + - query + type: object SecurityMonitoringTriageUser: description: Object representing a given user entity. properties: diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/frozen.json index d216dc53077e..162911518a98 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/frozen.json @@ -1 +1 @@ -"2022-01-06T00:52:08.681Z" +"2022-09-19T13:40:09.181Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/recording.har index d8dab5dbf331..71518f23ba3f 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "4d53ca3471085c101af20b2ff993dc32", + "_id": "3602fe699ca5aac813826a017e5dd9cf", "_order": 0, "cache": {}, "request": { @@ -26,23 +26,23 @@ "value": "application/json" } ], - "headersSize": 504, + "headersSize": 588, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"cases\":[{\"status\":\"info\"}],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_returns_Bad_Request_response-1641430328\",\"options\":{},\"queries\":[{\"query\":\"\"}],\"tags\":[]}" + "text": "{\"cases\":[{\"status\":\"info\"}],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_returns_Bad_Request_response-1663594809\",\"options\":{},\"queries\":[{\"query\":\"\"}],\"tags\":[]}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" }, "response": { - "bodySize": 29, + "bodySize": 30, "content": { "mimeType": "application/json", - "size": 29, - "text": "{\"errors\":[\"Internal error\"]}" + "size": 30, + "text": "{\"errors\":[\"Internal error\"]}\n" }, "cookies": [], "headers": [ @@ -51,14 +51,14 @@ "value": "application/json" } ], - "headersSize": 496, + "headersSize": 669, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 400, "statusText": "Bad Request" }, - "startedDateTime": "2022-01-06T00:52:08.685Z", - "time": 195 + "startedDateTime": "2022-09-19T13:40:09.188Z", + "time": 472 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/frozen.json index 8627e93ebc6b..d54d45885351 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/frozen.json @@ -1 +1 @@ -"2022-05-12T09:53:07.126Z" +"2022-09-19T11:07:29.388Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/recording.har index 7e86130a9a1f..c36ecebe08c9 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/recording.har @@ -8,11 +8,11 @@ }, "entries": [ { - "_id": "cdb5f475fce0a7af01e24228e5fd1bc7", + "_id": "e517e698af413b0cd5ecf1e20e34889f", "_order": 0, "cache": {}, "request": { - "bodySize": 395, + "bodySize": 418, "cookies": [], "headers": [ { @@ -26,23 +26,23 @@ "value": "application/json" } ], - "headersSize": 588, + "headersSize": 586, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1652349187\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[]}" + "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1663585649\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" }, "response": { - "bodySize": 604, + "bodySize": 592, "content": { "mimeType": "application/json", - "size": 604, - "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1652349187595,\"filters\":[],\"queries\":[{\"distinctFields\":[],\"name\":\"\",\"metric\":\"\",\"aggregation\":\"count\",\"groupByFields\":[],\"query\":\"@test:true\"}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"8tp-n1t-i19\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1652349187\"}\n" + "size": 592, + "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1663585649754,\"filters\":[],\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"nax-jvc-f8c\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1663585649\"}\n" }, "cookies": [], "headers": [ @@ -57,11 +57,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:53:07.128Z", - "time": 497 + "startedDateTime": "2022-09-19T11:07:29.394Z", + "time": 451 }, { - "_id": "13fb9de8cbe01fcde99fb09568ee9f4f", + "_id": "d6e0a4ec4b43b1d967ce1b35366edc66", "_order": 0, "cache": {}, "request": { @@ -74,11 +74,11 @@ "value": "*/*" } ], - "headersSize": 536, + "headersSize": 534, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/8tp-n1t-i19" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/nax-jvc-f8c" }, "response": { "bodySize": 0, @@ -88,14 +88,14 @@ }, "cookies": [], "headers": [], - "headersSize": 574, + "headersSize": 575, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-05-12T09:53:07.629Z", - "time": 493 + "startedDateTime": "2022-09-19T11:07:29.854Z", + "time": 596 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/frozen.json new file mode 100644 index 000000000000..90294141208f --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/frozen.json @@ -0,0 +1 @@ +"2022-09-19T10:52:17.321Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/recording.har new file mode 100644 index 000000000000..7f9ce121797a --- /dev/null +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/recording.har @@ -0,0 +1,284 @@ +{ + "log": { + "_recordingName": "Security Monitoring/Create a detection rule with type 'signal_correlation' returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "f87379fdda56237a4d013b426800cc74", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 447, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 588, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" + }, + "response": { + "bodySize": 621, + "content": { + "mimeType": "application/json", + "size": 621, + "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1663584737718,\"filters\":[],\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"wjo-ehv-wku\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-19T10:52:17.324Z", + "time": 467 + }, + { + "_id": "7d3689f4952cd4aa7156733a735db448", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 456, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 588, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule Bis\",\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737_bis\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:false\"}],\"tags\":[],\"type\":\"log_detection\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" + }, + "response": { + "bodySize": 630, + "content": { + "mimeType": "application/json", + "size": 630, + "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule Bis\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1663584738121,\"filters\":[],\"queries\":[{\"query\":\"@test:false\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"mfw-y8s-dhf\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737_bis\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-19T10:52:17.797Z", + "time": 397 + }, + { + "_id": "d09dc517f782c1e8ab1f647278675f0f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 587, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 588, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"cases\":[{\"condition\":\"a > 0 && b > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test signal correlation rule\",\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737_signal_rule\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"event_count\",\"correlatedByFields\":[\"host\"],\"correlatedQueryIndex\":1,\"ruleId\":\"wjo-ehv-wku\"},{\"aggregation\":\"event_count\",\"correlatedByFields\":[\"host\"],\"ruleId\":\"mfw-y8s-dhf\"}],\"tags\":[],\"type\":\"signal_correlation\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" + }, + "response": { + "bodySize": 861, + "content": { + "mimeType": "application/json", + "size": 861, + "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test signal correlation rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1663584738582,\"filters\":[],\"queries\":[{\"distinctFields\":[],\"correlatedByFields\":[\"host\"],\"name\":\"\",\"ruleId\":\"wjo-ehv-wku\",\"aggregation\":\"event_count\",\"groupByFields\":[],\"correlatedQueryIndex\":1},{\"distinctFields\":[],\"correlatedByFields\":[\"host\"],\"name\":\"\",\"ruleId\":\"mfw-y8s-dhf\",\"aggregation\":\"event_count\",\"groupByFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0 && b > 0\"}],\"type\":\"signal_correlation\",\"id\":\"rrg-f60-8ru\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737_signal_rule\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 627, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-19T10:52:18.200Z", + "time": 468 + }, + { + "_id": "9a26068d7557aaf5e9e7eed8f67992a9", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 536, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/rrg-f60-8ru" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 574, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2022-09-19T10:52:18.677Z", + "time": 362 + }, + { + "_id": "e02b059e65a848ee0b9b90b4122adea3", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 536, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/mfw-y8s-dhf" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 574, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2022-09-19T10:52:19.044Z", + "time": 396 + }, + { + "_id": "86a6113ab6fa53917139d6661c1754e5", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 536, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/wjo-ehv-wku" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 574, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2022-09-19T10:52:19.443Z", + "time": 462 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringRule.ts b/examples/v2/security-monitoring/CreateSecurityMonitoringRule.ts index bfc8517be3d3..02e3c78be19a 100644 --- a/examples/v2/security-monitoring/CreateSecurityMonitoringRule.ts +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringRule.ts @@ -36,6 +36,7 @@ const params: v2.SecurityMonitoringApiCreateSecurityMonitoringRuleRequest = { message: "Test rule", tags: [], isEnabled: true, + type: "log_detection", }, }; diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringRule_914562040.ts b/examples/v2/security-monitoring/CreateSecurityMonitoringRule_914562040.ts new file mode 100644 index 000000000000..b6871c282106 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringRule_914562040.ts @@ -0,0 +1,60 @@ +/** + * Create a detection rule with type 'signal_correlation' returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SecurityMonitoringApi(configuration); + +// there is a valid "security_rule" in the system +const SECURITY_RULE_ID = process.env.SECURITY_RULE_ID as string; + +// there is a valid "security_rule_bis" in the system +const SECURITY_RULE_BIS_ID = process.env.SECURITY_RULE_BIS_ID as string; + +const params: v2.SecurityMonitoringApiCreateSecurityMonitoringRuleRequest = { + body: { + name: "Example-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response_signal_rule", + queries: [ + { + ruleId: SECURITY_RULE_ID, + aggregation: "event_count", + correlatedByFields: ["host"], + correlatedQueryIndex: 1, + }, + { + ruleId: SECURITY_RULE_BIS_ID, + aggregation: "event_count", + correlatedByFields: ["host"], + }, + ], + filters: [], + cases: [ + { + name: "", + status: "info", + condition: "a > 0 && b > 0", + notifications: [], + }, + ], + options: { + evaluationWindow: 900, + keepAlive: 3600, + maxSignalDuration: 86400, + }, + message: "Test signal correlation rule", + tags: [], + isEnabled: true, + type: "signal_correlation", + }, +}; + +apiInstance + .createSecurityMonitoringRule(params) + .then((data: v2.SecurityMonitoringRuleResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/v2/given.json b/features/v2/given.json index e8efb57464a0..0a3a34949a36 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -218,6 +218,18 @@ "tag": "Security Monitoring", "operationId": "CreateSecurityMonitoringRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"name\": \"{{ unique }}_bis\",\n \"queries\": [{\n \"query\": \"@test:false\",\n \"aggregation\": \"count\",\n \"groupByFields\": [],\n \"distinctFields\": [],\n \"metric\": \"\"\n }],\n \"filters\": [],\n \"cases\": [{\n \"name\": \"\",\n \"status\": \"info\",\n \"condition\": \"a > 0\",\n \"notifications\": []\n }],\n \"options\": {\n \"evaluationWindow\": 900,\n \"keepAlive\": 3600,\n \"maxSignalDuration\": 86400\n },\n \"message\": \"Test rule Bis\",\n \"tags\": [],\n \"isEnabled\": true,\n \"type\": \"log_detection\"\n}" + } + ], + "step": "there is a valid \"security_rule_bis\" in the system", + "key": "security_rule_bis", + "tag": "Security Monitoring", + "operationId": "CreateSecurityMonitoringRule" + }, { "parameters": [ { diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index f3fd84625327..e25f9376cf62 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -65,7 +65,7 @@ Feature: Security Monitoring @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule returns "OK" response Given new "CreateSecurityMonitoringRule" request - And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true} + And body with value {"name":"{{ unique }}", "queries":[{"query":"@test:true","aggregation":"count","groupByFields":[],"distinctFields":[],"metric":""}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test rule","tags":[],"isEnabled":true, "type":"log_detection"} When the request is sent Then the response status is 200 OK @@ -76,6 +76,15 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @team:DataDog/k9-cloud-security-platform + Scenario: Create a detection rule with type 'signal_correlation' returns "OK" response + Given there is a valid "security_rule" in the system + And there is a valid "security_rule_bis" in the system + And new "CreateSecurityMonitoringRule" request + And body with value {"name":"{{ unique }}_signal_rule", "queries":[{"ruleId":"{{ security_rule.id }}","aggregation":"event_count","correlatedByFields":["host"],"correlatedQueryIndex":1}, {"ruleId":"{{ security_rule_bis.id }}","aggregation":"event_count","correlatedByFields":["host"]}],"filters":[],"cases":[{"name":"","status":"info","condition":"a > 0 && b > 0","notifications":[]}],"options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"message":"Test signal correlation rule","tags":[],"isEnabled":true, "type": "signal_correlation"} + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule with type 'workload_security' returns "OK" response Given new "CreateSecurityMonitoringRule" request diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index d4fba2d580a5..30e46b949f70 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -681,7 +681,6 @@ export { SecurityMonitoringRuleNewValueOptionsLearningThreshold } from "./models export { SecurityMonitoringRuleOptions } from "./models/SecurityMonitoringRuleOptions"; export { SecurityMonitoringRuleQuery } from "./models/SecurityMonitoringRuleQuery"; export { SecurityMonitoringRuleQueryAggregation } from "./models/SecurityMonitoringRuleQueryAggregation"; -export { SecurityMonitoringRuleQueryCreate } from "./models/SecurityMonitoringRuleQueryCreate"; export { SecurityMonitoringRuleResponse } from "./models/SecurityMonitoringRuleResponse"; export { SecurityMonitoringRuleSeverity } from "./models/SecurityMonitoringRuleSeverity"; export { SecurityMonitoringRuleTypeCreate } from "./models/SecurityMonitoringRuleTypeCreate"; @@ -699,6 +698,10 @@ export { SecurityMonitoringSignalIncidentsUpdateRequest } from "./models/Securit export { SecurityMonitoringSignalListRequest } from "./models/SecurityMonitoringSignalListRequest"; export { SecurityMonitoringSignalListRequestFilter } from "./models/SecurityMonitoringSignalListRequestFilter"; export { SecurityMonitoringSignalListRequestPage } from "./models/SecurityMonitoringSignalListRequestPage"; +export { SecurityMonitoringSignalRuleCreatePayload } from "./models/SecurityMonitoringSignalRuleCreatePayload"; +export { SecurityMonitoringSignalRuleQuery } from "./models/SecurityMonitoringSignalRuleQuery"; +export { SecurityMonitoringSignalRuleQueryCreate } from "./models/SecurityMonitoringSignalRuleQueryCreate"; +export { SecurityMonitoringSignalRuleTypeCreate } from "./models/SecurityMonitoringSignalRuleTypeCreate"; export { SecurityMonitoringSignalsListResponse } from "./models/SecurityMonitoringSignalsListResponse"; export { SecurityMonitoringSignalsListResponseLinks } from "./models/SecurityMonitoringSignalsListResponseLinks"; export { SecurityMonitoringSignalsListResponseMeta } from "./models/SecurityMonitoringSignalsListResponseMeta"; @@ -712,6 +715,9 @@ export { SecurityMonitoringSignalTriageAttributes } from "./models/SecurityMonit export { SecurityMonitoringSignalTriageUpdateData } from "./models/SecurityMonitoringSignalTriageUpdateData"; export { SecurityMonitoringSignalTriageUpdateResponse } from "./models/SecurityMonitoringSignalTriageUpdateResponse"; export { SecurityMonitoringSignalType } from "./models/SecurityMonitoringSignalType"; +export { SecurityMonitoringStandardRuleCreatePayload } from "./models/SecurityMonitoringStandardRuleCreatePayload"; +export { SecurityMonitoringStandardRuleQuery } from "./models/SecurityMonitoringStandardRuleQuery"; +export { SecurityMonitoringStandardRuleQueryCreate } from "./models/SecurityMonitoringStandardRuleQueryCreate"; export { SecurityMonitoringTriageUser } from "./models/SecurityMonitoringTriageUser"; export { ServiceAccountCreateAttributes } from "./models/ServiceAccountCreateAttributes"; export { ServiceAccountCreateData } from "./models/ServiceAccountCreateData"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 84dfefd4039d..e673ec5c3951 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -348,12 +348,9 @@ import { SecurityMonitoringFilter } from "./SecurityMonitoringFilter"; import { SecurityMonitoringListRulesResponse } from "./SecurityMonitoringListRulesResponse"; import { SecurityMonitoringRuleCase } from "./SecurityMonitoringRuleCase"; import { SecurityMonitoringRuleCaseCreate } from "./SecurityMonitoringRuleCaseCreate"; -import { SecurityMonitoringRuleCreatePayload } from "./SecurityMonitoringRuleCreatePayload"; import { SecurityMonitoringRuleImpossibleTravelOptions } from "./SecurityMonitoringRuleImpossibleTravelOptions"; import { SecurityMonitoringRuleNewValueOptions } from "./SecurityMonitoringRuleNewValueOptions"; import { SecurityMonitoringRuleOptions } from "./SecurityMonitoringRuleOptions"; -import { SecurityMonitoringRuleQuery } from "./SecurityMonitoringRuleQuery"; -import { SecurityMonitoringRuleQueryCreate } from "./SecurityMonitoringRuleQueryCreate"; import { SecurityMonitoringRuleResponse } from "./SecurityMonitoringRuleResponse"; import { SecurityMonitoringRuleUpdatePayload } from "./SecurityMonitoringRuleUpdatePayload"; import { SecurityMonitoringSignal } from "./SecurityMonitoringSignal"; @@ -367,6 +364,9 @@ import { SecurityMonitoringSignalIncidentsUpdateRequest } from "./SecurityMonito import { SecurityMonitoringSignalListRequest } from "./SecurityMonitoringSignalListRequest"; import { SecurityMonitoringSignalListRequestFilter } from "./SecurityMonitoringSignalListRequestFilter"; import { SecurityMonitoringSignalListRequestPage } from "./SecurityMonitoringSignalListRequestPage"; +import { SecurityMonitoringSignalRuleCreatePayload } from "./SecurityMonitoringSignalRuleCreatePayload"; +import { SecurityMonitoringSignalRuleQuery } from "./SecurityMonitoringSignalRuleQuery"; +import { SecurityMonitoringSignalRuleQueryCreate } from "./SecurityMonitoringSignalRuleQueryCreate"; import { SecurityMonitoringSignalStateUpdateAttributes } from "./SecurityMonitoringSignalStateUpdateAttributes"; import { SecurityMonitoringSignalStateUpdateData } from "./SecurityMonitoringSignalStateUpdateData"; import { SecurityMonitoringSignalStateUpdateRequest } from "./SecurityMonitoringSignalStateUpdateRequest"; @@ -377,6 +377,9 @@ import { SecurityMonitoringSignalsListResponse } from "./SecurityMonitoringSigna import { SecurityMonitoringSignalsListResponseLinks } from "./SecurityMonitoringSignalsListResponseLinks"; import { SecurityMonitoringSignalsListResponseMeta } from "./SecurityMonitoringSignalsListResponseMeta"; import { SecurityMonitoringSignalsListResponseMetaPage } from "./SecurityMonitoringSignalsListResponseMetaPage"; +import { SecurityMonitoringStandardRuleCreatePayload } from "./SecurityMonitoringStandardRuleCreatePayload"; +import { SecurityMonitoringStandardRuleQuery } from "./SecurityMonitoringStandardRuleQuery"; +import { SecurityMonitoringStandardRuleQueryCreate } from "./SecurityMonitoringStandardRuleQueryCreate"; import { SecurityMonitoringTriageUser } from "./SecurityMonitoringTriageUser"; import { ServiceAccountCreateAttributes } from "./ServiceAccountCreateAttributes"; import { ServiceAccountCreateData } from "./ServiceAccountCreateData"; @@ -624,11 +627,13 @@ const enumsMap: { [key: string]: any[] } = { "max", "new_value", "geo_data", + "event_count", ], SecurityMonitoringRuleSeverity: ["info", "low", "medium", "high", "critical"], SecurityMonitoringRuleTypeCreate: ["log_detection", "workload_security"], SecurityMonitoringRuleTypeRead: [ "log_detection", + "signal_correlation", "infrastructure_configuration", "workload_security", "cloud_configuration", @@ -639,6 +644,7 @@ const enumsMap: { [key: string]: any[] } = { "testing_or_maintenance", "other", ], + SecurityMonitoringSignalRuleTypeCreate: ["signal_correlation"], SecurityMonitoringSignalState: ["open", "archived", "under_review"], SecurityMonitoringSignalType: ["signal"], SecurityMonitoringSignalsSort: ["timestamp", "-timestamp"], @@ -1020,13 +1026,10 @@ const typeMap: { [index: string]: any } = { SecurityMonitoringListRulesResponse: SecurityMonitoringListRulesResponse, SecurityMonitoringRuleCase: SecurityMonitoringRuleCase, SecurityMonitoringRuleCaseCreate: SecurityMonitoringRuleCaseCreate, - SecurityMonitoringRuleCreatePayload: SecurityMonitoringRuleCreatePayload, SecurityMonitoringRuleImpossibleTravelOptions: SecurityMonitoringRuleImpossibleTravelOptions, SecurityMonitoringRuleNewValueOptions: SecurityMonitoringRuleNewValueOptions, SecurityMonitoringRuleOptions: SecurityMonitoringRuleOptions, - SecurityMonitoringRuleQuery: SecurityMonitoringRuleQuery, - SecurityMonitoringRuleQueryCreate: SecurityMonitoringRuleQueryCreate, SecurityMonitoringRuleResponse: SecurityMonitoringRuleResponse, SecurityMonitoringRuleUpdatePayload: SecurityMonitoringRuleUpdatePayload, SecurityMonitoringSignal: SecurityMonitoringSignal, @@ -1048,6 +1051,11 @@ const typeMap: { [index: string]: any } = { SecurityMonitoringSignalListRequestFilter, SecurityMonitoringSignalListRequestPage: SecurityMonitoringSignalListRequestPage, + SecurityMonitoringSignalRuleCreatePayload: + SecurityMonitoringSignalRuleCreatePayload, + SecurityMonitoringSignalRuleQuery: SecurityMonitoringSignalRuleQuery, + SecurityMonitoringSignalRuleQueryCreate: + SecurityMonitoringSignalRuleQueryCreate, SecurityMonitoringSignalStateUpdateAttributes: SecurityMonitoringSignalStateUpdateAttributes, SecurityMonitoringSignalStateUpdateData: @@ -1067,6 +1075,11 @@ const typeMap: { [index: string]: any } = { SecurityMonitoringSignalsListResponseMeta, SecurityMonitoringSignalsListResponseMetaPage: SecurityMonitoringSignalsListResponseMetaPage, + SecurityMonitoringStandardRuleCreatePayload: + SecurityMonitoringStandardRuleCreatePayload, + SecurityMonitoringStandardRuleQuery: SecurityMonitoringStandardRuleQuery, + SecurityMonitoringStandardRuleQueryCreate: + SecurityMonitoringStandardRuleQueryCreate, SecurityMonitoringTriageUser: SecurityMonitoringTriageUser, ServiceAccountCreateAttributes: ServiceAccountCreateAttributes, ServiceAccountCreateData: ServiceAccountCreateData, @@ -1139,6 +1152,14 @@ const oneOfMap: { [index: string]: string[] } = { ], RUMGroupByMissing: ["string", "number"], RUMGroupByTotal: ["boolean", "string", "number"], + SecurityMonitoringRuleCreatePayload: [ + "SecurityMonitoringStandardRuleCreatePayload", + "SecurityMonitoringSignalRuleCreatePayload", + ], + SecurityMonitoringRuleQuery: [ + "SecurityMonitoringStandardRuleQuery", + "SecurityMonitoringSignalRuleQuery", + ], UserResponseIncludedItem: ["Organization", "Permission", "Role"], }; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleCreatePayload.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleCreatePayload.ts index baeb6eb4bee4..cc51cc6dcfb9 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleCreatePayload.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleCreatePayload.ts @@ -3,122 +3,16 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { SecurityMonitoringFilter } from "./SecurityMonitoringFilter"; -import { SecurityMonitoringRuleCaseCreate } from "./SecurityMonitoringRuleCaseCreate"; -import { SecurityMonitoringRuleOptions } from "./SecurityMonitoringRuleOptions"; -import { SecurityMonitoringRuleQueryCreate } from "./SecurityMonitoringRuleQueryCreate"; -import { SecurityMonitoringRuleTypeCreate } from "./SecurityMonitoringRuleTypeCreate"; +import { SecurityMonitoringSignalRuleCreatePayload } from "./SecurityMonitoringSignalRuleCreatePayload"; +import { SecurityMonitoringStandardRuleCreatePayload } from "./SecurityMonitoringStandardRuleCreatePayload"; -import { AttributeTypeMap } from "../../datadog-api-client-common/util"; +import { UnparsedObject } from "../../datadog-api-client-common/util"; /** * Create a new rule. */ -export class SecurityMonitoringRuleCreatePayload { - /** - * Cases for generating signals. - */ - "cases": Array; - /** - * Additional queries to filter matched events before they are processed. - */ - "filters"?: Array; - /** - * Whether the notifications include the triggering group-by values in their title. - */ - "hasExtendedTitle"?: boolean; - /** - * Whether the rule is enabled. - */ - "isEnabled": boolean; - /** - * Message for generated signals. - */ - "message": string; - /** - * The name of the rule. - */ - "name": string; - /** - * Options on rules. - */ - "options": SecurityMonitoringRuleOptions; - /** - * Queries for selecting logs which are part of the rule. - */ - "queries": Array; - /** - * Tags for generated signals. - */ - "tags"?: Array; - /** - * The rule type. - */ - "type"?: SecurityMonitoringRuleTypeCreate; - /** - * @ignore - */ - "unparsedObject"?: any; - - /** - * @ignore - */ - static readonly attributeTypeMap: AttributeTypeMap = { - cases: { - baseName: "cases", - type: "Array", - required: true, - }, - filters: { - baseName: "filters", - type: "Array", - }, - hasExtendedTitle: { - baseName: "hasExtendedTitle", - type: "boolean", - }, - isEnabled: { - baseName: "isEnabled", - type: "boolean", - required: true, - }, - message: { - baseName: "message", - type: "string", - required: true, - }, - name: { - baseName: "name", - type: "string", - required: true, - }, - options: { - baseName: "options", - type: "SecurityMonitoringRuleOptions", - required: true, - }, - queries: { - baseName: "queries", - type: "Array", - required: true, - }, - tags: { - baseName: "tags", - type: "Array", - }, - type: { - baseName: "type", - type: "SecurityMonitoringRuleTypeCreate", - }, - }; - - /** - * @ignore - */ - static getAttributeTypeMap(): AttributeTypeMap { - return SecurityMonitoringRuleCreatePayload.attributeTypeMap; - } - - public constructor() {} -} +export type SecurityMonitoringRuleCreatePayload = + | SecurityMonitoringStandardRuleCreatePayload + | SecurityMonitoringSignalRuleCreatePayload + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleQuery.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleQuery.ts index 902758439786..8d70a15e0154 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleQuery.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleQuery.ts @@ -3,89 +3,16 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { SecurityMonitoringRuleQueryAggregation } from "./SecurityMonitoringRuleQueryAggregation"; +import { SecurityMonitoringSignalRuleQuery } from "./SecurityMonitoringSignalRuleQuery"; +import { SecurityMonitoringStandardRuleQuery } from "./SecurityMonitoringStandardRuleQuery"; -import { AttributeTypeMap } from "../../datadog-api-client-common/util"; +import { UnparsedObject } from "../../datadog-api-client-common/util"; /** * Query for matching rule. */ -export class SecurityMonitoringRuleQuery { - /** - * The aggregation type. - */ - "aggregation"?: SecurityMonitoringRuleQueryAggregation; - /** - * Field for which the cardinality is measured. Sent as an array. - */ - "distinctFields"?: Array; - /** - * Fields to group by. - */ - "groupByFields"?: Array; - /** - * The target field to aggregate over when using the sum or max - * aggregations. - */ - "metric"?: string; - /** - * Group of target fields to aggregate over when using the new value aggregations. - */ - "metrics"?: Array; - /** - * Name of the query. - */ - "name"?: string; - /** - * Query to run on logs. - */ - "query"?: string; - /** - * @ignore - */ - "unparsedObject"?: any; - - /** - * @ignore - */ - static readonly attributeTypeMap: AttributeTypeMap = { - aggregation: { - baseName: "aggregation", - type: "SecurityMonitoringRuleQueryAggregation", - }, - distinctFields: { - baseName: "distinctFields", - type: "Array", - }, - groupByFields: { - baseName: "groupByFields", - type: "Array", - }, - metric: { - baseName: "metric", - type: "string", - }, - metrics: { - baseName: "metrics", - type: "Array", - }, - name: { - baseName: "name", - type: "string", - }, - query: { - baseName: "query", - type: "string", - }, - }; - - /** - * @ignore - */ - static getAttributeTypeMap(): AttributeTypeMap { - return SecurityMonitoringRuleQuery.attributeTypeMap; - } - - public constructor() {} -} +export type SecurityMonitoringRuleQuery = + | SecurityMonitoringStandardRuleQuery + | SecurityMonitoringSignalRuleQuery + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleQueryAggregation.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleQueryAggregation.ts index acb5c1a0142b..a8185d472793 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleQueryAggregation.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleQueryAggregation.ts @@ -10,10 +10,12 @@ export type SecurityMonitoringRuleQueryAggregation = | typeof SUM | typeof MAX | typeof NEW_VALUE - | typeof GEO_DATA; + | typeof GEO_DATA + | typeof EVENT_COUNT; export const COUNT = "count"; export const CARDINALITY = "cardinality"; export const SUM = "sum"; export const MAX = "max"; export const NEW_VALUE = "new_value"; export const GEO_DATA = "geo_data"; +export const EVENT_COUNT = "event_count"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleTypeRead.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleTypeRead.ts index dc28854bae83..b701cc714cba 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleTypeRead.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleTypeRead.ts @@ -6,10 +6,12 @@ export type SecurityMonitoringRuleTypeRead = | typeof LOG_DETECTION + | typeof SIGNAL_CORRELATION | typeof INFRASTRUCTURE_CONFIGURATION | typeof WORKLOAD_SECURITY | typeof CLOUD_CONFIGURATION; export const LOG_DETECTION = "log_detection"; +export const SIGNAL_CORRELATION = "signal_correlation"; export const INFRASTRUCTURE_CONFIGURATION = "infrastructure_configuration"; export const WORKLOAD_SECURITY = "workload_security"; export const CLOUD_CONFIGURATION = "cloud_configuration"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleCreatePayload.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleCreatePayload.ts new file mode 100644 index 000000000000..157ddc7cb81c --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleCreatePayload.ts @@ -0,0 +1,124 @@ +/** + * 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. + */ +import { SecurityMonitoringFilter } from "./SecurityMonitoringFilter"; +import { SecurityMonitoringRuleCaseCreate } from "./SecurityMonitoringRuleCaseCreate"; +import { SecurityMonitoringRuleOptions } from "./SecurityMonitoringRuleOptions"; +import { SecurityMonitoringSignalRuleQueryCreate } from "./SecurityMonitoringSignalRuleQueryCreate"; +import { SecurityMonitoringSignalRuleTypeCreate } from "./SecurityMonitoringSignalRuleTypeCreate"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Create a new signal correlation rule. + */ +export class SecurityMonitoringSignalRuleCreatePayload { + /** + * Cases for generating signals. + */ + "cases": Array; + /** + * Additional queries to filter matched events before they are processed. + */ + "filters"?: Array; + /** + * Whether the notifications include the triggering group-by values in their title. + */ + "hasExtendedTitle"?: boolean; + /** + * Whether the rule is enabled. + */ + "isEnabled": boolean; + /** + * Message for generated signals. + */ + "message": string; + /** + * The name of the rule. + */ + "name": string; + /** + * Options on rules. + */ + "options": SecurityMonitoringRuleOptions; + /** + * Queries for selecting signals which are part of the rule. + */ + "queries": Array; + /** + * Tags for generated signals. + */ + "tags"?: Array; + /** + * The rule type. + */ + "type"?: SecurityMonitoringSignalRuleTypeCreate; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + cases: { + baseName: "cases", + type: "Array", + required: true, + }, + filters: { + baseName: "filters", + type: "Array", + }, + hasExtendedTitle: { + baseName: "hasExtendedTitle", + type: "boolean", + }, + isEnabled: { + baseName: "isEnabled", + type: "boolean", + required: true, + }, + message: { + baseName: "message", + type: "string", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + options: { + baseName: "options", + type: "SecurityMonitoringRuleOptions", + required: true, + }, + queries: { + baseName: "queries", + type: "Array", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + }, + type: { + baseName: "type", + type: "SecurityMonitoringSignalRuleTypeCreate", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringSignalRuleCreatePayload.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQuery.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQuery.ts new file mode 100644 index 000000000000..2683c8437ab1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQuery.ts @@ -0,0 +1,83 @@ +/** + * 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. + */ +import { SecurityMonitoringRuleQueryAggregation } from "./SecurityMonitoringRuleQueryAggregation"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Query for matching rule on signals + */ +export class SecurityMonitoringSignalRuleQuery { + /** + * The aggregation type. + */ + "aggregation"?: SecurityMonitoringRuleQueryAggregation; + /** + * Fields to group by. + */ + "correlatedByFields"?: Array; + /** + * Index of the rule query used to retrieve the correlated field. + */ + "correlatedQueryIndex"?: number; + /** + * Group of target fields to aggregate over when using the new value aggregations. + */ + "metrics"?: Array; + /** + * Name of the query. + */ + "name"?: string; + /** + * Rule ID to match on signals. + */ + "ruleId"?: string; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + aggregation: { + baseName: "aggregation", + type: "SecurityMonitoringRuleQueryAggregation", + }, + correlatedByFields: { + baseName: "correlatedByFields", + type: "Array", + }, + correlatedQueryIndex: { + baseName: "correlatedQueryIndex", + type: "number", + format: "int32", + }, + metrics: { + baseName: "metrics", + type: "Array", + }, + name: { + baseName: "name", + type: "string", + }, + ruleId: { + baseName: "ruleId", + type: "string", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringSignalRuleQuery.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQueryCreate.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQueryCreate.ts new file mode 100644 index 000000000000..08ea1c5082e3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQueryCreate.ts @@ -0,0 +1,84 @@ +/** + * 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. + */ +import { SecurityMonitoringRuleQueryAggregation } from "./SecurityMonitoringRuleQueryAggregation"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Query for matching rule on signals + */ +export class SecurityMonitoringSignalRuleQueryCreate { + /** + * The aggregation type. + */ + "aggregation"?: SecurityMonitoringRuleQueryAggregation; + /** + * Fields to group by. + */ + "correlatedByFields"?: Array; + /** + * Index of the rule query used to retrieve the correlated field. + */ + "correlatedQueryIndex"?: number; + /** + * Group of target fields to aggregate over when using the new value aggregations. + */ + "metrics"?: Array; + /** + * Name of the query. + */ + "name"?: string; + /** + * Rule ID to match on signals. + */ + "ruleId": string; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + aggregation: { + baseName: "aggregation", + type: "SecurityMonitoringRuleQueryAggregation", + }, + correlatedByFields: { + baseName: "correlatedByFields", + type: "Array", + }, + correlatedQueryIndex: { + baseName: "correlatedQueryIndex", + type: "number", + format: "int32", + }, + metrics: { + baseName: "metrics", + type: "Array", + }, + name: { + baseName: "name", + type: "string", + }, + ruleId: { + baseName: "ruleId", + type: "string", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringSignalRuleQueryCreate.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleTypeCreate.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleTypeCreate.ts new file mode 100644 index 000000000000..862a14c6f8e4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleTypeCreate.ts @@ -0,0 +1,8 @@ +/** + * 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. + */ + +export type SecurityMonitoringSignalRuleTypeCreate = typeof SIGNAL_CORRELATION; +export const SIGNAL_CORRELATION = "signal_correlation"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleCreatePayload.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleCreatePayload.ts new file mode 100644 index 000000000000..45f5d55ca52e --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleCreatePayload.ts @@ -0,0 +1,124 @@ +/** + * 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. + */ +import { SecurityMonitoringFilter } from "./SecurityMonitoringFilter"; +import { SecurityMonitoringRuleCaseCreate } from "./SecurityMonitoringRuleCaseCreate"; +import { SecurityMonitoringRuleOptions } from "./SecurityMonitoringRuleOptions"; +import { SecurityMonitoringRuleTypeCreate } from "./SecurityMonitoringRuleTypeCreate"; +import { SecurityMonitoringStandardRuleQueryCreate } from "./SecurityMonitoringStandardRuleQueryCreate"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Create a new rule. + */ +export class SecurityMonitoringStandardRuleCreatePayload { + /** + * Cases for generating signals. + */ + "cases": Array; + /** + * Additional queries to filter matched events before they are processed. + */ + "filters"?: Array; + /** + * Whether the notifications include the triggering group-by values in their title. + */ + "hasExtendedTitle"?: boolean; + /** + * Whether the rule is enabled. + */ + "isEnabled": boolean; + /** + * Message for generated signals. + */ + "message": string; + /** + * The name of the rule. + */ + "name": string; + /** + * Options on rules. + */ + "options": SecurityMonitoringRuleOptions; + /** + * Queries for selecting logs which are part of the rule. + */ + "queries": Array; + /** + * Tags for generated signals. + */ + "tags"?: Array; + /** + * The rule type. + */ + "type"?: SecurityMonitoringRuleTypeCreate; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + cases: { + baseName: "cases", + type: "Array", + required: true, + }, + filters: { + baseName: "filters", + type: "Array", + }, + hasExtendedTitle: { + baseName: "hasExtendedTitle", + type: "boolean", + }, + isEnabled: { + baseName: "isEnabled", + type: "boolean", + required: true, + }, + message: { + baseName: "message", + type: "string", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + options: { + baseName: "options", + type: "SecurityMonitoringRuleOptions", + required: true, + }, + queries: { + baseName: "queries", + type: "Array", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + }, + type: { + baseName: "type", + type: "SecurityMonitoringRuleTypeCreate", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringStandardRuleCreatePayload.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQuery.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQuery.ts new file mode 100644 index 000000000000..882f6972d241 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQuery.ts @@ -0,0 +1,91 @@ +/** + * 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. + */ +import { SecurityMonitoringRuleQueryAggregation } from "./SecurityMonitoringRuleQueryAggregation"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Query for matching rule. + */ +export class SecurityMonitoringStandardRuleQuery { + /** + * The aggregation type. + */ + "aggregation"?: SecurityMonitoringRuleQueryAggregation; + /** + * Field for which the cardinality is measured. Sent as an array. + */ + "distinctFields"?: Array; + /** + * Fields to group by. + */ + "groupByFields"?: Array; + /** + * The target field to aggregate over when using the sum or max + * aggregations. + */ + "metric"?: string; + /** + * Group of target fields to aggregate over when using the new value aggregations. + */ + "metrics"?: Array; + /** + * Name of the query. + */ + "name"?: string; + /** + * Query to run on logs. + */ + "query"?: string; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + aggregation: { + baseName: "aggregation", + type: "SecurityMonitoringRuleQueryAggregation", + }, + distinctFields: { + baseName: "distinctFields", + type: "Array", + }, + groupByFields: { + baseName: "groupByFields", + type: "Array", + }, + metric: { + baseName: "metric", + type: "string", + }, + metrics: { + baseName: "metrics", + type: "Array", + }, + name: { + baseName: "name", + type: "string", + }, + query: { + baseName: "query", + type: "string", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringStandardRuleQuery.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleQueryCreate.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQueryCreate.ts similarity index 93% rename from packages/datadog-api-client-v2/models/SecurityMonitoringRuleQueryCreate.ts rename to packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQueryCreate.ts index c14bff4042cc..2bc10eba247b 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleQueryCreate.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQueryCreate.ts @@ -10,7 +10,7 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; /** * Query for matching rule. */ -export class SecurityMonitoringRuleQueryCreate { +export class SecurityMonitoringStandardRuleQueryCreate { /** * The aggregation type. */ @@ -85,7 +85,7 @@ export class SecurityMonitoringRuleQueryCreate { * @ignore */ static getAttributeTypeMap(): AttributeTypeMap { - return SecurityMonitoringRuleQueryCreate.attributeTypeMap; + return SecurityMonitoringStandardRuleQueryCreate.attributeTypeMap; } public constructor() {} From cfcf8c186d9e177aae142a76c34c46d42ecf7257 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 15:02:06 +0000 Subject: [PATCH 22/30] Regenerate client from commit 27106c20 of spec repo (#847) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 70 ++++++ .../frozen.json | 1 + .../recording.har | 206 ++++++++++++++++++ .../dashboards/CreateDashboard_1423904722.ts | 52 +++++ features/v1/dashboards.feature | 11 + .../slo_list_widget.json | 32 +++ packages/datadog-api-client-v1/index.ts | 5 + .../models/ObjectSerializer.ts | 9 + .../models/SLOListWidgetDefinition.ts | 78 +++++++ .../models/SLOListWidgetDefinitionType.ts | 8 + .../models/SLOListWidgetQuery.ts | 51 +++++ .../models/SLOListWidgetRequest.ts | 53 +++++ .../models/SLOListWidgetRequestType.ts | 8 + .../models/WidgetDefinition.ts | 2 + 15 files changed, 590 insertions(+), 4 deletions(-) create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-slo-list-widget_885923584/frozen.json create mode 100644 cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-slo-list-widget_885923584/recording.har create mode 100644 examples/v1/dashboards/CreateDashboard_1423904722.ts create mode 100644 features/v1/dashboards_json_payload/slo_list_widget.json create mode 100644 packages/datadog-api-client-v1/models/SLOListWidgetDefinition.ts create mode 100644 packages/datadog-api-client-v1/models/SLOListWidgetDefinitionType.ts create mode 100644 packages/datadog-api-client-v1/models/SLOListWidgetQuery.ts create mode 100644 packages/datadog-api-client-v1/models/SLOListWidgetRequest.ts create mode 100644 packages/datadog-api-client-v1/models/SLOListWidgetRequestType.ts diff --git a/.apigentools-info b/.apigentools-info index 279e662f39b3..68b64207f474 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-26 09:51:31.902097", - "spec_repo_commit": "24936e30" + "regenerated": "2022-09-26 14:13:13.234730", + "spec_repo_commit": "27106c20" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-26 09:51:31.917551", - "spec_repo_commit": "24936e30" + "regenerated": "2022-09-26 14:13:13.251814", + "spec_repo_commit": "27106c20" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index cb2f1640dc0a..af2a3b29abeb 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -9270,6 +9270,75 @@ components: format: int64 type: integer type: object + SLOListWidgetDefinition: + description: Use the SLO List widget to track your SLOs (Service Level Objectives) + on dashboards. + properties: + requests: + description: Array of one request object to display in the widget. + items: + $ref: '#/components/schemas/SLOListWidgetRequest' + maxItems: 1 + minItems: 1 + type: array + title: + description: Title of the widget. + type: string + title_align: + $ref: '#/components/schemas/WidgetTextAlign' + title_size: + description: Size of the title. + type: string + type: + $ref: '#/components/schemas/SLOListWidgetDefinitionType' + required: + - type + - requests + type: object + SLOListWidgetDefinitionType: + default: slo_list + description: Type of the SLO List widget. + enum: + - slo_list + example: slo_list + type: string + x-enum-varnames: + - SLO_LIST + SLOListWidgetQuery: + description: Updated SLO List widget. + properties: + limit: + default: 100 + description: Maximum number of results to display in the table. + format: int64 + maximum: 100 + minimum: 1 + type: integer + query_string: + description: Widget query. + example: env:prod AND service:my-app + type: string + required: + - query_string + type: object + SLOListWidgetRequest: + description: Updated SLO List widget. + properties: + query: + $ref: '#/components/schemas/SLOListWidgetQuery' + request_type: + $ref: '#/components/schemas/SLOListWidgetRequestType' + required: + - query + - request_type + type: object + SLOListWidgetRequestType: + description: Widget request type. + enum: + - slo_list + type: string + x-enum-varnames: + - SLO_LIST SLOOverallStatuses: description: Overall status of the SLO by timeframes. properties: @@ -17348,6 +17417,7 @@ components: - $ref: '#/components/schemas/QueryValueWidgetDefinition' - $ref: '#/components/schemas/ScatterPlotWidgetDefinition' - $ref: '#/components/schemas/SLOWidgetDefinition' + - $ref: '#/components/schemas/SLOListWidgetDefinition' - $ref: '#/components/schemas/ServiceMapWidgetDefinition' - $ref: '#/components/schemas/ServiceSummaryWidgetDefinition' - $ref: '#/components/schemas/SunburstWidgetDefinition' diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-slo-list-widget_885923584/frozen.json b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-slo-list-widget_885923584/frozen.json new file mode 100644 index 000000000000..ed8b97120c31 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-slo-list-widget_885923584/frozen.json @@ -0,0 +1 @@ +"2022-09-21T14:58:35.783Z" diff --git a/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-slo-list-widget_885923584/recording.har b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-slo-list-widget_885923584/recording.har new file mode 100644 index 000000000000..6c25b0ec4a23 --- /dev/null +++ b/cassettes/v1/Dashboards_1335235736/Create-a-new-dashboard-with-slo-list-widget_885923584/recording.har @@ -0,0 +1,206 @@ +{ + "log": { + "_recordingName": "Dashboards/Create a new dashboard with slo list widget", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "2839d3d9d3c57889cd6eee6bb561bac8", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 270, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 547, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"name\":\"Test-Create_a_new_dashboard_with_slo_list_widget-1663772315\",\"query\":{\"denominator\":\"sum:httpservice.hits{!code:3xx}.as_count()\",\"numerator\":\"sum:httpservice.hits{code:2xx}.as_count()\"},\"thresholds\":[{\"target\":95,\"timeframe\":\"7d\",\"warning\":98}],\"type\":\"metric\"}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/slo" + }, + "response": { + "bodySize": 575, + "content": { + "mimeType": "application/json", + "size": 575, + "text": "{\"data\":[{\"description\":\"\",\"monitor_tags\":[],\"creator\":{\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"thresholds\":[{\"warning\":98.0,\"warning_display\":\"98.\",\"target\":95.0,\"target_display\":\"95.\",\"timeframe\":\"7d\"}],\"type_id\":1,\"query\":{\"denominator\":\"sum:httpservice.hits{!code:3xx}.as_count()\",\"numerator\":\"sum:httpservice.hits{code:2xx}.as_count()\"},\"id\":\"7f88381afe5f5c1e987664e7057253fd\",\"name\":\"Test-Create_a_new_dashboard_with_slo_list_widget-1663772315\",\"created_at\":1663772316,\"tags\":[],\"modified_at\":1663772316,\"type\":\"metric\"}],\"error\":null}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 619, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-21T14:58:35.802Z", + "time": 574 + }, + { + "_id": "634c497ca94124af52948714b215b0ee", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 410, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":\"\",\"is_read_only\":false,\"layout_type\":\"free\",\"notify_list\":[],\"template_variables\":[],\"title\":\"Test-Create_a_new_dashboard_with_slo_list_widget-1663772315\",\"widgets\":[{\"definition\":{\"requests\":[{\"query\":{\"limit\":75,\"query_string\":\"env:prod AND service:my-app\"},\"request_type\":\"slo_list\"}],\"title_align\":\"left\",\"title_size\":\"16\",\"type\":\"slo_list\"},\"layout\":{\"height\":21,\"width\":60,\"x\":0,\"y\":0}}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard" + }, + "response": { + "bodySize": 710, + "content": { + "mimeType": "application/json", + "size": 710, + "text": "{\"notify_list\":[],\"description\":\"\",\"restricted_roles\":[],\"author_name\":null,\"template_variables\":[],\"is_read_only\":false,\"id\":\"xf3-y64-ib5\",\"title\":\"Test-Create_a_new_dashboard_with_slo_list_widget-1663772315\",\"url\":\"/dashboard/xf3-y64-ib5/test-createanewdashboardwithslolistwidget-1663772315\",\"created_at\":\"2022-09-21T14:58:36.648616+00:00\",\"modified_at\":\"2022-09-21T14:58:36.648616+00:00\",\"author_handle\":\"frog@datadoghq.com\",\"widgets\":[{\"definition\":{\"type\":\"slo_list\",\"requests\":[{\"query\":{\"query_string\":\"env:prod AND service:my-app\",\"limit\":75},\"request_type\":\"slo_list\"}],\"title_align\":\"left\",\"title_size\":\"16\"},\"layout\":{\"y\":0,\"width\":60,\"x\":0,\"height\":21},\"id\":434825034616209}],\"layout_type\":\"free\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 593, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-21T14:58:36.388Z", + "time": 338 + }, + { + "_id": "f2ac0c6bc92815ab8c0a6d864b5178f8", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 520, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/dashboard/xf3-y64-ib5" + }, + "response": { + "bodySize": 39, + "content": { + "mimeType": "application/json", + "size": 39, + "text": "{\"deleted_dashboard_id\":\"xf3-y64-ib5\"}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 592, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-21T14:58:36.737Z", + "time": 374 + }, + { + "_id": "3ba0b158cb4723a3e05d3ffaa6afb990", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 529, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/slo/7f88381afe5f5c1e987664e7057253fd" + }, + "response": { + "bodySize": 59, + "content": { + "mimeType": "application/json", + "size": 59, + "text": "{\"data\":[\"7f88381afe5f5c1e987664e7057253fd\"],\"error\":null}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 619, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-21T14:58:37.116Z", + "time": 397 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v1/dashboards/CreateDashboard_1423904722.ts b/examples/v1/dashboards/CreateDashboard_1423904722.ts new file mode 100644 index 000000000000..c078030eaba2 --- /dev/null +++ b/examples/v1/dashboards/CreateDashboard_1423904722.ts @@ -0,0 +1,52 @@ +/** + * Create a new dashboard with slo list widget + */ + +import { client, v1 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v1.DashboardsApi(configuration); + +const params: v1.DashboardsApiCreateDashboardRequest = { + body: { + title: "Example-Create_a_new_dashboard_with_slo_list_widget", + description: "", + widgets: [ + { + layout: { + x: 0, + y: 0, + width: 60, + height: 21, + }, + definition: { + titleSize: "16", + titleAlign: "left", + type: "slo_list", + requests: [ + { + query: { + queryString: "env:prod AND service:my-app", + limit: 75, + }, + requestType: "slo_list", + }, + ], + }, + }, + ], + templateVariables: [], + layoutType: "free", + isReadOnly: false, + notifyList: [], + }, +}; + +apiInstance + .createDashboard(params) + .then((data: v1.Dashboard) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/v1/dashboards.feature b/features/v1/dashboards.feature index a2b47a9be1b6..5dcd26d429fb 100644 --- a/features/v1/dashboards.feature +++ b/features/v1/dashboards.feature @@ -410,6 +410,17 @@ Feature: Dashboards And the response "widgets[0].definition.type" is equal to "servicemap" And the response "widgets[0].definition.filters" is equal to ["env:none","environment:*"] + @team:DataDog/dashboards + Scenario: Create a new dashboard with slo list widget + Given there is a valid "slo" in the system + And new "CreateDashboard" request + And body from file "dashboards_json_payload/slo_list_widget.json" + When the request is sent + Then the response status is 200 OK + And the response "widgets[0].definition.type" is equal to "slo_list" + And the response "widgets[0].definition.requests[0].query.query_string" is equal to "env:prod AND service:my-app" + And the response "widgets[0].definition.requests[0].query.limit" is equal to 75 + @team:DataDog/dashboards Scenario: Create a new dashboard with slo widget Given there is a valid "slo" in the system diff --git a/features/v1/dashboards_json_payload/slo_list_widget.json b/features/v1/dashboards_json_payload/slo_list_widget.json new file mode 100644 index 000000000000..74b5916587f8 --- /dev/null +++ b/features/v1/dashboards_json_payload/slo_list_widget.json @@ -0,0 +1,32 @@ +{ + "title": "{{ unique }}", + "description": "", + "widgets": [ + { + "layout": { + "x": 0, + "y": 0, + "width": 60, + "height": 21 + }, + "definition": { + "title_size": "16", + "title_align": "left", + "type": "slo_list", + "requests": [ + { + "query": { + "query_string": "env:prod AND service:my-app", + "limit": 75 + }, + "request_type": "slo_list" + } + ] + } + } + ], + "template_variables": [], + "layout_type": "free", + "is_read_only": false, + "notify_list": [] +} diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index 878304be8750..6b8cda2def99 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -739,6 +739,11 @@ export { SLOHistorySLIData } from "./models/SLOHistorySLIData"; export { SLOListResponse } from "./models/SLOListResponse"; export { SLOListResponseMetadata } from "./models/SLOListResponseMetadata"; export { SLOListResponseMetadataPage } from "./models/SLOListResponseMetadataPage"; +export { SLOListWidgetDefinition } from "./models/SLOListWidgetDefinition"; +export { SLOListWidgetDefinitionType } from "./models/SLOListWidgetDefinitionType"; +export { SLOListWidgetQuery } from "./models/SLOListWidgetQuery"; +export { SLOListWidgetRequest } from "./models/SLOListWidgetRequest"; +export { SLOListWidgetRequestType } from "./models/SLOListWidgetRequestType"; export { SLOOverallStatuses } from "./models/SLOOverallStatuses"; export { SLORawErrorBudgetRemaining } from "./models/SLORawErrorBudgetRemaining"; export { SLOResponse } from "./models/SLOResponse"; diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index a77e00d0076f..a4bd13692584 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -289,6 +289,9 @@ import { SLOHistorySLIData } from "./SLOHistorySLIData"; import { SLOListResponse } from "./SLOListResponse"; import { SLOListResponseMetadata } from "./SLOListResponseMetadata"; import { SLOListResponseMetadataPage } from "./SLOListResponseMetadataPage"; +import { SLOListWidgetDefinition } from "./SLOListWidgetDefinition"; +import { SLOListWidgetQuery } from "./SLOListWidgetQuery"; +import { SLOListWidgetRequest } from "./SLOListWidgetRequest"; import { SLOOverallStatuses } from "./SLOOverallStatuses"; import { SLORawErrorBudgetRemaining } from "./SLORawErrorBudgetRemaining"; import { SLOResponse } from "./SLOResponse"; @@ -863,6 +866,8 @@ const enumsMap: { [key: string]: any[] } = { ], SLOCorrectionType: ["correction"], SLOErrorTimeframe: ["7d", "30d", "90d", "all"], + SLOListWidgetDefinitionType: ["slo_list"], + SLOListWidgetRequestType: ["slo_list"], SLOTimeframe: ["7d", "30d", "90d", "custom"], SLOType: ["metric", "monitor"], SLOTypeNumeric: [0, 1], @@ -1603,6 +1608,9 @@ const typeMap: { [index: string]: any } = { SLOListResponse: SLOListResponse, SLOListResponseMetadata: SLOListResponseMetadata, SLOListResponseMetadataPage: SLOListResponseMetadataPage, + SLOListWidgetDefinition: SLOListWidgetDefinition, + SLOListWidgetQuery: SLOListWidgetQuery, + SLOListWidgetRequest: SLOListWidgetRequest, SLOOverallStatuses: SLOOverallStatuses, SLORawErrorBudgetRemaining: SLORawErrorBudgetRemaining, SLOResponse: SLOResponse, @@ -1963,6 +1971,7 @@ const oneOfMap: { [index: string]: string[] } = { "QueryValueWidgetDefinition", "ScatterPlotWidgetDefinition", "SLOWidgetDefinition", + "SLOListWidgetDefinition", "ServiceMapWidgetDefinition", "ServiceSummaryWidgetDefinition", "SunburstWidgetDefinition", diff --git a/packages/datadog-api-client-v1/models/SLOListWidgetDefinition.ts b/packages/datadog-api-client-v1/models/SLOListWidgetDefinition.ts new file mode 100644 index 000000000000..1ccdb4e0aa61 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SLOListWidgetDefinition.ts @@ -0,0 +1,78 @@ +/** + * 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. + */ +import { SLOListWidgetDefinitionType } from "./SLOListWidgetDefinitionType"; +import { SLOListWidgetRequest } from "./SLOListWidgetRequest"; +import { WidgetTextAlign } from "./WidgetTextAlign"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Use the SLO List widget to track your SLOs (Service Level Objectives) on dashboards. + */ +export class SLOListWidgetDefinition { + /** + * Array of one request object to display in the widget. + */ + "requests": [SLOListWidgetRequest]; + /** + * Title of the widget. + */ + "title"?: string; + /** + * How to align the text on the widget. + */ + "titleAlign"?: WidgetTextAlign; + /** + * Size of the title. + */ + "titleSize"?: string; + /** + * Type of the SLO List widget. + */ + "type": SLOListWidgetDefinitionType; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + requests: { + baseName: "requests", + type: "[SLOListWidgetRequest]", + required: true, + }, + title: { + baseName: "title", + type: "string", + }, + titleAlign: { + baseName: "title_align", + type: "WidgetTextAlign", + }, + titleSize: { + baseName: "title_size", + type: "string", + }, + type: { + baseName: "type", + type: "SLOListWidgetDefinitionType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SLOListWidgetDefinition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/SLOListWidgetDefinitionType.ts b/packages/datadog-api-client-v1/models/SLOListWidgetDefinitionType.ts new file mode 100644 index 000000000000..a5bf43ebe341 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SLOListWidgetDefinitionType.ts @@ -0,0 +1,8 @@ +/** + * 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. + */ + +export type SLOListWidgetDefinitionType = typeof SLO_LIST; +export const SLO_LIST = "slo_list"; diff --git a/packages/datadog-api-client-v1/models/SLOListWidgetQuery.ts b/packages/datadog-api-client-v1/models/SLOListWidgetQuery.ts new file mode 100644 index 000000000000..8efc20c41115 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SLOListWidgetQuery.ts @@ -0,0 +1,51 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Updated SLO List widget. + */ +export class SLOListWidgetQuery { + /** + * Maximum number of results to display in the table. + */ + "limit"?: number; + /** + * Widget query. + */ + "queryString": string; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + limit: { + baseName: "limit", + type: "number", + format: "int64", + }, + queryString: { + baseName: "query_string", + type: "string", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SLOListWidgetQuery.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/SLOListWidgetRequest.ts b/packages/datadog-api-client-v1/models/SLOListWidgetRequest.ts new file mode 100644 index 000000000000..1c9a244e1b76 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SLOListWidgetRequest.ts @@ -0,0 +1,53 @@ +/** + * 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. + */ +import { SLOListWidgetQuery } from "./SLOListWidgetQuery"; +import { SLOListWidgetRequestType } from "./SLOListWidgetRequestType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Updated SLO List widget. + */ +export class SLOListWidgetRequest { + /** + * Updated SLO List widget. + */ + "query": SLOListWidgetQuery; + /** + * Widget request type. + */ + "requestType": SLOListWidgetRequestType; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + query: { + baseName: "query", + type: "SLOListWidgetQuery", + required: true, + }, + requestType: { + baseName: "request_type", + type: "SLOListWidgetRequestType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SLOListWidgetRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/SLOListWidgetRequestType.ts b/packages/datadog-api-client-v1/models/SLOListWidgetRequestType.ts new file mode 100644 index 000000000000..0eca89915c02 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SLOListWidgetRequestType.ts @@ -0,0 +1,8 @@ +/** + * 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. + */ + +export type SLOListWidgetRequestType = typeof SLO_LIST; +export const SLO_LIST = "slo_list"; diff --git a/packages/datadog-api-client-v1/models/WidgetDefinition.ts b/packages/datadog-api-client-v1/models/WidgetDefinition.ts index 121603061ed9..a718a33a4517 100644 --- a/packages/datadog-api-client-v1/models/WidgetDefinition.ts +++ b/packages/datadog-api-client-v1/models/WidgetDefinition.ts @@ -26,6 +26,7 @@ import { QueryValueWidgetDefinition } from "./QueryValueWidgetDefinition"; import { ScatterPlotWidgetDefinition } from "./ScatterPlotWidgetDefinition"; import { ServiceMapWidgetDefinition } from "./ServiceMapWidgetDefinition"; import { ServiceSummaryWidgetDefinition } from "./ServiceSummaryWidgetDefinition"; +import { SLOListWidgetDefinition } from "./SLOListWidgetDefinition"; import { SLOWidgetDefinition } from "./SLOWidgetDefinition"; import { SunburstWidgetDefinition } from "./SunburstWidgetDefinition"; import { TableWidgetDefinition } from "./TableWidgetDefinition"; @@ -61,6 +62,7 @@ export type WidgetDefinition = | QueryValueWidgetDefinition | ScatterPlotWidgetDefinition | SLOWidgetDefinition + | SLOListWidgetDefinition | ServiceMapWidgetDefinition | ServiceSummaryWidgetDefinition | SunburstWidgetDefinition From f51eb28329fa89f86001a7397af3caf076f2843a Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 15:59:38 +0000 Subject: [PATCH 23/30] Regenerate client from commit c7261a1b of spec repo (#839) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 88 +++++++- .../frozen.json | 1 + .../recording.har | 66 ++++++ .../frozen.json | 1 + .../recording.har | 70 +++++++ .../usage-metering/GetEstimatedCostByOrg.ts | 7 +- .../GetEstimatedCostByOrg_2734954020.ts | 1 - .../GetEstimatedCostByOrg_3186693804.ts | 1 - .../usage-metering/GetHistoricalCostByOrg.ts | 22 ++ features/v2/undo.json | 6 + features/v2/usage_metering.feature | 31 ++- .../configuration.ts | 1 - .../apis/UsageMeteringApi.ts | 191 ++++++++++++++++-- packages/datadog-api-client-v2/index.ts | 1 + 15 files changed, 445 insertions(+), 50 deletions(-) create mode 100644 cassettes/v2/Usage-Metering_938753175/Get-historical-cost-across-your-account-returns-OK-response_457581091/frozen.json create mode 100644 cassettes/v2/Usage-Metering_938753175/Get-historical-cost-across-your-account-returns-OK-response_457581091/recording.har create mode 100644 cassettes/v2/Usage-Metering_938753175/GetEstimatedCostByOrg-with-both-start_month-and-start_date-returns-Bad-Request-response_3256531067/frozen.json create mode 100644 cassettes/v2/Usage-Metering_938753175/GetEstimatedCostByOrg-with-both-start_month-and-start_date-returns-Bad-Request-response_3256531067/recording.har create mode 100644 examples/v2/usage-metering/GetHistoricalCostByOrg.ts diff --git a/.apigentools-info b/.apigentools-info index 68b64207f474..65c9111ff241 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-26 14:13:13.234730", - "spec_repo_commit": "27106c20" + "regenerated": "2022-09-26 15:35:36.025207", + "spec_repo_commit": "c7261a1b" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-26 14:13:13.251814", - "spec_repo_commit": "27106c20" + "regenerated": "2022-09-26 15:35:36.037463", + "spec_repo_commit": "c7261a1b" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a7ff6a4a7b3a..a7aa3e2089cb 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13884,8 +13884,17 @@ paths: - Usage Metering /api/v2/usage/cost_by_org: get: - description: Get cost across multi-org account. Cost by org data for a given - month becomes available no later than the 16th of the following month. + deprecated: true + description: 'Get cost across multi-org account. + + Cost by org data for a given month becomes available no later than the 16th + of the following month. + + **Note:** This endpoint has been deprecated. Please use the new endpoint + + [`/historical_cost`](https://docs.datadoghq.com/api/latest/usage-metering/#get-historical-cost-across-your-account) + + instead.' operationId: GetCostByOrg parameters: - description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` @@ -13942,14 +13951,16 @@ paths: description: 'Get estimated cost across multi-org and single root-org accounts. Estimated cost data is only available for the current month and previous month. - To access historical costs prior to this, use the /cost_by_org endpoint.' + + To access historical costs prior to this, use the `/historical_cost` endpoint.' operationId: GetEstimatedCostByOrg parameters: - description: String to specify whether cost is broken down at a parent-org - level or at the sub-org level. Currently, only the 'sub-org' view is supported. + level or at the sub-org level. Available views are `summary` and `sub-org`. + Defaults to `summary`. in: query name: view - required: true + required: false schema: type: string - description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` @@ -14021,10 +14032,71 @@ paths: summary: Get estimated cost across your account tags: - Usage Metering - x-unstable: '**Note**: This endpoint is in public beta. + /api/v2/usage/historical_cost: + get: + description: 'Get historical cost across multi-org and single root-org accounts. - Only the sub-org view is available currently, the summary view will be released - at a later date.' + Cost data for a given month becomes available no later than the 16th of the + following month.' + operationId: GetHistoricalCostByOrg + parameters: + - description: String to specify whether cost is broken down at a parent-org + level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults + to `summary`. + in: query + name: view + required: false + schema: + type: string + - description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` + for cost beginning this month.' + in: query + name: start_month + required: true + schema: + format: date-time + type: string + - description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` + for cost ending this month.' + in: query + name: end_month + required: false + schema: + format: date-time + type: string + responses: + '200': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/CostByOrgResponse' + description: OK + '400': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden - User is not authorized + '429': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - usage_read + summary: Get historical cost across your account + tags: + - Usage Metering /api/v2/usage/hourly_usage: get: description: Get hourly usage by product family diff --git a/cassettes/v2/Usage-Metering_938753175/Get-historical-cost-across-your-account-returns-OK-response_457581091/frozen.json b/cassettes/v2/Usage-Metering_938753175/Get-historical-cost-across-your-account-returns-OK-response_457581091/frozen.json new file mode 100644 index 000000000000..da11a25e0ca9 --- /dev/null +++ b/cassettes/v2/Usage-Metering_938753175/Get-historical-cost-across-your-account-returns-OK-response_457581091/frozen.json @@ -0,0 +1 @@ +"2022-09-26T15:25:36.139Z" diff --git a/cassettes/v2/Usage-Metering_938753175/Get-historical-cost-across-your-account-returns-OK-response_457581091/recording.har b/cassettes/v2/Usage-Metering_938753175/Get-historical-cost-across-your-account-returns-OK-response_457581091/recording.har new file mode 100644 index 000000000000..5e9d7f044501 --- /dev/null +++ b/cassettes/v2/Usage-Metering_938753175/Get-historical-cost-across-your-account-returns-OK-response_457581091/recording.har @@ -0,0 +1,66 @@ +{ + "log": { + "_recordingName": "Usage Metering/Get historical cost across your account returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "14a2f32aa94f0a5e97568a925f25104b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json;datetime-format=rfc3339" + } + ], + "headersSize": 602, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "start_month", + "value": "2022-09-26T15:24:36.139Z" + }, + { + "name": "view", + "value": "sub-org" + } + ], + "url": "https://api.datadoghq.com/api/v2/usage/historical_cost?start_month=2022-09-26T15%3A24%3A36.139Z&view=sub-org" + }, + "response": { + "bodySize": 12, + "content": { + "mimeType": "application/json", + "size": 12, + "text": "{\"data\":[]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 603, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-26T15:25:36.148Z", + "time": 290 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Usage-Metering_938753175/GetEstimatedCostByOrg-with-both-start_month-and-start_date-returns-Bad-Request-response_3256531067/frozen.json b/cassettes/v2/Usage-Metering_938753175/GetEstimatedCostByOrg-with-both-start_month-and-start_date-returns-Bad-Request-response_3256531067/frozen.json new file mode 100644 index 000000000000..c06d7dc938b0 --- /dev/null +++ b/cassettes/v2/Usage-Metering_938753175/GetEstimatedCostByOrg-with-both-start_month-and-start_date-returns-Bad-Request-response_3256531067/frozen.json @@ -0,0 +1 @@ +"2022-09-23T14:04:15.545Z" diff --git a/cassettes/v2/Usage-Metering_938753175/GetEstimatedCostByOrg-with-both-start_month-and-start_date-returns-Bad-Request-response_3256531067/recording.har b/cassettes/v2/Usage-Metering_938753175/GetEstimatedCostByOrg-with-both-start_month-and-start_date-returns-Bad-Request-response_3256531067/recording.har new file mode 100644 index 000000000000..bbb661d6066b --- /dev/null +++ b/cassettes/v2/Usage-Metering_938753175/GetEstimatedCostByOrg-with-both-start_month-and-start_date-returns-Bad-Request-response_3256531067/recording.har @@ -0,0 +1,70 @@ +{ + "log": { + "_recordingName": "Usage Metering/GetEstimatedCostByOrg with both start_month and start_date returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "6f83bc6b9f6d8855ab2010ced5adc5f0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json;datetime-format=rfc3339" + } + ], + "headersSize": 640, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [ + { + "name": "view", + "value": "sub-org" + }, + { + "name": "start_month", + "value": "2022-09-20T14:04:15.545Z" + }, + { + "name": "start_date", + "value": "2022-09-20T14:04:15.545Z" + } + ], + "url": "https://api.datadoghq.com/api/v2/usage/estimated_cost?view=sub-org&start_month=2022-09-20T14%3A04%3A15.545Z&start_date=2022-09-20T14%3A04%3A15.545Z" + }, + "response": { + "bodySize": 96, + "content": { + "mimeType": "application/json", + "size": 96, + "text": "{\"errors\":[\"API called with non-parent org keys. Data is only available at the root level org\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 665, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2022-09-23T14:04:15.571Z", + "time": 624 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/usage-metering/GetEstimatedCostByOrg.ts b/examples/v2/usage-metering/GetEstimatedCostByOrg.ts index 982232318888..e97a258a0cb2 100644 --- a/examples/v2/usage-metering/GetEstimatedCostByOrg.ts +++ b/examples/v2/usage-metering/GetEstimatedCostByOrg.ts @@ -5,15 +5,10 @@ import { client, v2 } from "@datadog/datadog-api-client"; const configuration = client.createConfiguration(); -configuration.unstableOperations["v2.getEstimatedCostByOrg"] = true; const apiInstance = new v2.UsageMeteringApi(configuration); -const params: v2.UsageMeteringApiGetEstimatedCostByOrgRequest = { - view: "view", -}; - apiInstance - .getEstimatedCostByOrg(params) + .getEstimatedCostByOrg() .then((data: v2.CostByOrgResponse) => { console.log( "API called successfully. Returned data: " + JSON.stringify(data) diff --git a/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.ts b/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.ts index 931331256ecb..76f2319497b2 100644 --- a/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.ts +++ b/examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.ts @@ -5,7 +5,6 @@ import { client, v2 } from "@datadog/datadog-api-client"; const configuration = client.createConfiguration(); -configuration.unstableOperations["v2.getEstimatedCostByOrg"] = true; const apiInstance = new v2.UsageMeteringApi(configuration); const params: v2.UsageMeteringApiGetEstimatedCostByOrgRequest = { diff --git a/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.ts b/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.ts index cbbb5608dc3a..872c9b50103e 100644 --- a/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.ts +++ b/examples/v2/usage-metering/GetEstimatedCostByOrg_3186693804.ts @@ -5,7 +5,6 @@ import { client, v2 } from "@datadog/datadog-api-client"; const configuration = client.createConfiguration(); -configuration.unstableOperations["v2.getEstimatedCostByOrg"] = true; const apiInstance = new v2.UsageMeteringApi(configuration); const params: v2.UsageMeteringApiGetEstimatedCostByOrgRequest = { diff --git a/examples/v2/usage-metering/GetHistoricalCostByOrg.ts b/examples/v2/usage-metering/GetHistoricalCostByOrg.ts new file mode 100644 index 000000000000..30c56c5b77bb --- /dev/null +++ b/examples/v2/usage-metering/GetHistoricalCostByOrg.ts @@ -0,0 +1,22 @@ +/** + * Get historical cost across your account returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.UsageMeteringApi(configuration); + +const params: v2.UsageMeteringApiGetHistoricalCostByOrgRequest = { + view: "sub-org", + startMonth: new Date(new Date().getTime() + -1 * 60 * 1000), +}; + +apiInstance + .getHistoricalCostByOrg(params) + .then((data: v2.CostByOrgResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/v2/undo.json b/features/v2/undo.json index ab8314e7e7dc..1e42d9388dd8 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -928,6 +928,12 @@ "type": "safe" } }, + "GetHistoricalCostByOrg": { + "tag": "Usage Metering", + "undo": { + "type": "safe" + } + }, "GetHourlyUsage": { "tag": "Usage Metering", "undo": { diff --git a/features/v2/usage_metering.feature b/features/v2/usage_metering.feature index e5639fc6c663..3edf8d79524a 100644 --- a/features/v2/usage_metering.feature +++ b/features/v2/usage_metering.feature @@ -30,17 +30,28 @@ Feature: Usage Metering @generated @skip @team:DataDog/red-zone-revenue-query Scenario: Get estimated cost across your account returns "Bad Request" response - Given operation "GetEstimatedCostByOrg" enabled - And new "GetEstimatedCostByOrg" request - And request contains "view" parameter from "REPLACE.ME" + Given new "GetEstimatedCostByOrg" request When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/red-zone-revenue-query Scenario: Get estimated cost across your account returns "OK" response - Given operation "GetEstimatedCostByOrg" enabled - And new "GetEstimatedCostByOrg" request - And request contains "view" parameter from "REPLACE.ME" + Given new "GetEstimatedCostByOrg" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/red-zone-revenue-query + Scenario: Get historical cost across your account returns "Bad Request" response + Given new "GetHistoricalCostByOrg" request + And request contains "start_month" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/red-zone-revenue-query + Scenario: Get historical cost across your account returns "OK" response + Given new "GetHistoricalCostByOrg" request + And request contains "start_month" parameter with value "{{ timeISO('now - 1m') }}" + And request contains "view" parameter with value "sub-org" When the request is sent Then the response status is 200 OK @@ -151,7 +162,7 @@ Feature: Usage Metering When the request is sent Then the response status is 200 OK - @skip @team:DataDog/red-zone-revenue-query + @team:DataDog/red-zone-revenue-query Scenario: GetEstimatedCostByOrg with both start_month and start_date returns "Bad Request" response Given new "GetEstimatedCostByOrg" request And request contains "view" parameter with value "sub-org" @@ -162,8 +173,7 @@ Feature: Usage Metering @replay-only @team:DataDog/red-zone-revenue-query Scenario: GetEstimatedCostByOrg with start_date returns "OK" response - Given operation "GetEstimatedCostByOrg" enabled - And new "GetEstimatedCostByOrg" request + Given new "GetEstimatedCostByOrg" request And request contains "view" parameter with value "sub-org" And request contains "start_date" parameter with value "{{ timeISO('now - 5d') }}" When the request is sent @@ -171,8 +181,7 @@ Feature: Usage Metering @skip @team:DataDog/red-zone-revenue-query Scenario: GetEstimatedCostByOrg with start_month returns "OK" response - Given operation "GetEstimatedCostByOrg" enabled - And new "GetEstimatedCostByOrg" request + Given new "GetEstimatedCostByOrg" request And request contains "view" parameter with value "sub-org" And request contains "start_month" parameter with value "{{ timeISO('now - 5d') }}" When the request is sent diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 0ee12841c5db..80b76f89108b 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -131,7 +131,6 @@ export function createConfiguration( "v2.getIncidentTeam": false, "v2.listIncidentTeams": false, "v2.updateIncidentTeam": false, - "v2.getEstimatedCostByOrg": false, }, httpApi: conf.httpApi || new DefaultHttpLibrary(), authMethods: configureAuthMethods(authMethods), diff --git a/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts b/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts index 7560d3919a5f..ac49bb90c42c 100644 --- a/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts +++ b/packages/datadog-api-client-v2/apis/UsageMeteringApi.ts @@ -78,7 +78,7 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { } public async getEstimatedCostByOrg( - view: string, + view?: string, startMonth?: Date, endMonth?: Date, startDate?: Date, @@ -87,18 +87,6 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { ): Promise { const _config = _options || this.configuration; - logger.warn("Using unstable operation 'getEstimatedCostByOrg'"); - if (!_config.unstableOperations["v2.getEstimatedCostByOrg"]) { - throw new Error("Unstable operation 'getEstimatedCostByOrg' is disabled"); - } - - // verify required parameter 'view' is not null or undefined - if (view === null || view === undefined) { - throw new RequiredError( - "Required parameter view was null or undefined when calling getEstimatedCostByOrg." - ); - } - // Path Params const localVarPath = "/api/v2/usage/estimated_cost"; @@ -155,6 +143,65 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getHistoricalCostByOrg( + startMonth: Date, + view?: string, + endMonth?: Date, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'startMonth' is not null or undefined + if (startMonth === null || startMonth === undefined) { + throw new RequiredError( + "Required parameter startMonth was null or undefined when calling getHistoricalCostByOrg." + ); + } + + // Path Params + const localVarPath = "/api/v2/usage/historical_cost"; + + // Make Request Context + const requestContext = getServer( + _config, + "v2.UsageMeteringApi.getHistoricalCostByOrg" + ).makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam( + "Accept", + "application/json;datetime-format=rfc3339" + ); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (view !== undefined) { + requestContext.setQueryParam( + "view", + ObjectSerializer.serialize(view, "string", "") + ); + } + if (startMonth !== undefined) { + requestContext.setQueryParam( + "start_month", + ObjectSerializer.serialize(startMonth, "Date", "date-time") + ); + } + if (endMonth !== undefined) { + requestContext.setQueryParam( + "end_month", + ObjectSerializer.serialize(endMonth, "Date", "date-time") + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async getHourlyUsage( filterTimestampStart: Date, filterProductFamilies: string, @@ -529,6 +576,67 @@ export class UsageMeteringApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getHistoricalCostByOrg + * @throws ApiException if the response code was not in [200, 299] + */ + public async getHistoricalCostByOrg( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode == 200) { + const body: CostByOrgResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CostByOrgResponse" + ) as CostByOrgResponse; + return body; + } + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 403 || + response.httpStatusCode == 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: CostByOrgResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "CostByOrgResponse", + "" + ) as CostByOrgResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -795,10 +903,10 @@ export interface UsageMeteringApiGetCostByOrgRequest { export interface UsageMeteringApiGetEstimatedCostByOrgRequest { /** - * String to specify whether cost is broken down at a parent-org level or at the sub-org level. Currently, only the 'sub-org' view is supported. + * String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults to `summary`. * @type string */ - view: string; + view?: string; /** * Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost beginning this month. Either start_month or start_date should be specified, but not both. (start_month cannot go beyond two months in the past) * @type Date @@ -821,6 +929,24 @@ export interface UsageMeteringApiGetEstimatedCostByOrgRequest { endDate?: Date; } +export interface UsageMeteringApiGetHistoricalCostByOrgRequest { + /** + * Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost beginning this month. + * @type Date + */ + startMonth: Date; + /** + * String to specify whether cost is broken down at a parent-org level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults to `summary`. + * @type string + */ + view?: string; + /** + * Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for cost ending this month. + * @type Date + */ + endMonth?: Date; +} + export interface UsageMeteringApiGetHourlyUsageRequest { /** * Datetime in ISO-8601 format, UTC, precise to hour: [YYYY-MM-DDThh] for usage beginning at this hour. @@ -926,7 +1052,11 @@ export class UsageMeteringApi { } /** - * Get cost across multi-org account. Cost by org data for a given month becomes available no later than the 16th of the following month. + * Get cost across multi-org account. + * Cost by org data for a given month becomes available no later than the 16th of the following month. + * **Note:** This endpoint has been deprecated. Please use the new endpoint + * [`/historical_cost`](https://docs.datadoghq.com/api/latest/usage-metering/#get-historical-cost-across-your-account) + * instead. * @param param The request object */ public getCostByOrg( @@ -949,11 +1079,12 @@ export class UsageMeteringApi { /** * Get estimated cost across multi-org and single root-org accounts. - * Estimated cost data is only available for the current month and previous month. To access historical costs prior to this, use the /cost_by_org endpoint. + * Estimated cost data is only available for the current month and previous month. + * To access historical costs prior to this, use the `/historical_cost` endpoint. * @param param The request object */ public getEstimatedCostByOrg( - param: UsageMeteringApiGetEstimatedCostByOrgRequest, + param: UsageMeteringApiGetEstimatedCostByOrgRequest = {}, options?: Configuration ): Promise { const requestContextPromise = this.requestFactory.getEstimatedCostByOrg( @@ -973,6 +1104,30 @@ export class UsageMeteringApi { }); } + /** + * Get historical cost across multi-org and single root-org accounts. + * Cost data for a given month becomes available no later than the 16th of the following month. + * @param param The request object + */ + public getHistoricalCostByOrg( + param: UsageMeteringApiGetHistoricalCostByOrgRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getHistoricalCostByOrg( + param.startMonth, + param.view, + param.endMonth, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getHistoricalCostByOrg(responseContext); + }); + }); + } + /** * Get hourly usage by product family * @param param The request object diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 30e46b949f70..b2896543857a 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -200,6 +200,7 @@ export { export { UsageMeteringApiGetCostByOrgRequest, UsageMeteringApiGetEstimatedCostByOrgRequest, + UsageMeteringApiGetHistoricalCostByOrgRequest, UsageMeteringApiGetHourlyUsageRequest, UsageMeteringApiGetUsageApplicationSecurityMonitoringRequest, UsageMeteringApiGetUsageLambdaTracedInvocationsRequest, From 51b4546f4793ee071f1de9294987d9c8feb7f628 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 15:45:01 +0200 Subject: [PATCH 24/30] Regenerate client from commit 2bc1a788 of spec repo (#854) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 259 +++++++++--------- .../frozen.json | 2 +- .../recording.har | 8 +- .../frozen.json | 2 +- .../recording.har | 22 +- .../frozen.json | 2 +- .../recording.har | 24 +- .../frozen.json | 2 +- .../recording.har | 54 ++-- .../frozen.json | 2 +- .../recording.har | 24 +- .../frozen.json | 2 +- .../recording.har | 34 +-- .../frozen.json | 2 +- .../recording.har | 48 ++-- .../frozen.json | 2 +- .../recording.har | 32 +-- .../frozen.json | 2 +- .../recording.har | 54 ++-- .../frozen.json | 2 +- .../recording.har | 18 +- .../frozen.json | 2 +- .../recording.har | 56 ++-- .../UpdateSecurityMonitoringRule.ts | 1 + features/v2/security_monitoring.feature | 6 +- packages/datadog-api-client-v2/index.ts | 6 +- .../models/ObjectSerializer.ts | 20 +- .../models/SecurityMonitoringRuleResponse.ts | 176 +----------- .../models/SecurityMonitoringRuleTypeRead.ts | 2 - ...curityMonitoringSignalRuleCreatePayload.ts | 12 +- .../SecurityMonitoringSignalRuleQuery.ts | 3 +- ...SecurityMonitoringSignalRuleQueryCreate.ts | 84 ------ .../SecurityMonitoringSignalRuleResponse.ts | 178 ++++++++++++ ...ts => SecurityMonitoringSignalRuleType.ts} | 2 +- ...rityMonitoringStandardRuleCreatePayload.ts | 6 +- .../SecurityMonitoringStandardRuleQuery.ts | 3 +- ...curityMonitoringStandardRuleQueryCreate.ts | 92 ------- .../SecurityMonitoringStandardRuleResponse.ts | 178 ++++++++++++ 39 files changed, 729 insertions(+), 703 deletions(-) delete mode 100644 packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQueryCreate.ts create mode 100644 packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleResponse.ts rename packages/datadog-api-client-v2/models/{SecurityMonitoringSignalRuleTypeCreate.ts => SecurityMonitoringSignalRuleType.ts} (78%) delete mode 100644 packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQueryCreate.ts create mode 100644 packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleResponse.ts diff --git a/.apigentools-info b/.apigentools-info index 65c9111ff241..4b92b2e5eb0e 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-26 15:35:36.025207", - "spec_repo_commit": "c7261a1b" + "regenerated": "2022-09-28 09:08:38.326030", + "spec_repo_commit": "2bc1a788" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-26 15:35:36.037463", - "spec_repo_commit": "c7261a1b" + "regenerated": "2022-09-28 09:08:38.338291", + "spec_repo_commit": "2bc1a788" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a7aa3e2089cb..a0ac7e9a3d2c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -7245,72 +7245,11 @@ components: - GEO_DATA - EVENT_COUNT SecurityMonitoringRuleResponse: - description: Rule. - properties: - cases: - description: Cases for generating signals. - items: - $ref: '#/components/schemas/SecurityMonitoringRuleCase' - type: array - createdAt: - description: When the rule was created, timestamp in milliseconds. - format: int64 - type: integer - creationAuthorId: - description: User ID of the user who created the rule. - format: int64 - type: integer - filters: - description: Additional queries to filter matched events before they are - processed. - items: - $ref: '#/components/schemas/SecurityMonitoringFilter' - type: array - hasExtendedTitle: - description: Whether the notifications include the triggering group-by values - in their title. - type: boolean - id: - description: The ID of the rule. - type: string - isDefault: - description: Whether the rule is included by default. - type: boolean - isDeleted: - description: Whether the rule has been deleted. - type: boolean - isEnabled: - description: Whether the rule is enabled. - type: boolean - message: - description: Message for generated signals. - type: string - name: - description: The name of the rule. - type: string - options: - $ref: '#/components/schemas/SecurityMonitoringRuleOptions' - queries: - description: Queries for selecting logs which are part of the rule. - items: - $ref: '#/components/schemas/SecurityMonitoringRuleQuery' - type: array - tags: - description: Tags for generated signals. - items: - description: Tag. - type: string - type: array - type: - $ref: '#/components/schemas/SecurityMonitoringRuleTypeRead' - updateAuthorId: - description: User ID of the user who updated the rule. - format: int64 - type: integer - version: - description: The version of the rule. - format: int64 - type: integer + description: Create a new rule. + oneOf: + - $ref: '#/components/schemas/SecurityMonitoringStandardRuleResponse' + - $ref: '#/components/schemas/SecurityMonitoringSignalRuleResponse' + type: object SecurityMonitoringRuleSeverity: description: Severity of the Security Signal. enum: @@ -7340,14 +7279,12 @@ components: description: The rule type. enum: - log_detection - - signal_correlation - infrastructure_configuration - workload_security - cloud_configuration type: string x-enum-varnames: - LOG_DETECTION - - SIGNAL_CORRELATION - INFRASTRUCTURE_CONFIGURATION - WORKLOAD_SECURITY - CLOUD_CONFIGURATION @@ -7611,7 +7548,7 @@ components: description: Queries for selecting signals which are part of the rule. example: [] items: - $ref: '#/components/schemas/SecurityMonitoringSignalRuleQueryCreate' + $ref: '#/components/schemas/SecurityMonitoringSignalRuleQuery' type: array tags: description: Tags for generated signals. @@ -7623,7 +7560,7 @@ components: type: string type: array type: - $ref: '#/components/schemas/SecurityMonitoringSignalRuleTypeCreate' + $ref: '#/components/schemas/SecurityMonitoringSignalRuleType' required: - name - isEnabled @@ -7660,42 +7597,79 @@ components: type: string ruleId: description: Rule ID to match on signals. + example: d3f-ru1-e1d type: string + required: + - ruleId type: object - SecurityMonitoringSignalRuleQueryCreate: - description: Query for matching rule on signals + SecurityMonitoringSignalRuleResponse: + description: Rule. properties: - aggregation: - $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' - correlatedByFields: - description: Fields to group by. + cases: + description: Cases for generating signals. items: - description: Field. - type: string + $ref: '#/components/schemas/SecurityMonitoringRuleCase' type: array - correlatedQueryIndex: - description: Index of the rule query used to retrieve the correlated field. - format: int32 - maximum: 9 + createdAt: + description: When the rule was created, timestamp in milliseconds. + format: int64 type: integer - metrics: - description: Group of target fields to aggregate over when using the new - value aggregations. + creationAuthorId: + description: User ID of the user who created the rule. + format: int64 + type: integer + filters: + description: Additional queries to filter matched events before they are + processed. items: - description: Field. - type: string + $ref: '#/components/schemas/SecurityMonitoringFilter' type: array - name: - description: Name of the query. + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + type: boolean + id: + description: The ID of the rule. type: string - ruleId: - description: Rule ID to match on signals. - example: d3f-ru1-e1d + isDefault: + description: Whether the rule is included by default. + type: boolean + isDeleted: + description: Whether the rule has been deleted. + type: boolean + isEnabled: + description: Whether the rule is enabled. + type: boolean + message: + description: Message for generated signals. type: string - required: - - ruleId - type: object - SecurityMonitoringSignalRuleTypeCreate: + name: + description: The name of the rule. + type: string + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting logs which are part of the rule. + items: + $ref: '#/components/schemas/SecurityMonitoringSignalRuleQuery' + type: array + tags: + description: Tags for generated signals. + items: + description: Tag. + type: string + type: array + type: + $ref: '#/components/schemas/SecurityMonitoringSignalRuleType' + updateAuthorId: + description: User ID of the user who updated the rule. + format: int64 + type: integer + version: + description: The version of the rule. + format: int64 + type: integer + SecurityMonitoringSignalRuleType: description: The rule type. enum: - signal_correlation @@ -7896,7 +7870,7 @@ components: description: Queries for selecting logs which are part of the rule. example: [] items: - $ref: '#/components/schemas/SecurityMonitoringStandardRuleQueryCreate' + $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' type: array tags: description: Tags for generated signals. @@ -7951,47 +7925,78 @@ components: type: string query: description: Query to run on logs. + example: a > 3 type: string + required: + - query type: object - SecurityMonitoringStandardRuleQueryCreate: - description: Query for matching rule. + SecurityMonitoringStandardRuleResponse: + description: Rule. properties: - aggregation: - $ref: '#/components/schemas/SecurityMonitoringRuleQueryAggregation' - distinctFields: - description: Field for which the cardinality is measured. Sent as an array. + cases: + description: Cases for generating signals. items: - description: Field. - type: string + $ref: '#/components/schemas/SecurityMonitoringRuleCase' type: array - groupByFields: - description: Fields to group by. + createdAt: + description: When the rule was created, timestamp in milliseconds. + format: int64 + type: integer + creationAuthorId: + description: User ID of the user who created the rule. + format: int64 + type: integer + filters: + description: Additional queries to filter matched events before they are + processed. items: - description: Field. - type: string + $ref: '#/components/schemas/SecurityMonitoringFilter' type: array - metric: - description: 'The target field to aggregate over when using the sum or max - - aggregations.' + hasExtendedTitle: + description: Whether the notifications include the triggering group-by values + in their title. + type: boolean + id: + description: The ID of the rule. type: string - metrics: - description: Group of target fields to aggregate over when using the new - value aggregations. + isDefault: + description: Whether the rule is included by default. + type: boolean + isDeleted: + description: Whether the rule has been deleted. + type: boolean + isEnabled: + description: Whether the rule is enabled. + type: boolean + message: + description: Message for generated signals. + type: string + name: + description: The name of the rule. + type: string + options: + $ref: '#/components/schemas/SecurityMonitoringRuleOptions' + queries: + description: Queries for selecting logs which are part of the rule. items: - description: Field. + $ref: '#/components/schemas/SecurityMonitoringStandardRuleQuery' + type: array + tags: + description: Tags for generated signals. + items: + description: Tag. type: string type: array - name: - description: Name of the query. - type: string - query: - description: Query to run on logs. - example: a > 3 - type: string - required: - - query - type: object + type: + $ref: '#/components/schemas/SecurityMonitoringRuleTypeRead' + updateAuthorId: + description: User ID of the user who updated the rule. + format: int64 + type: integer + version: + description: The version of the rule. + format: int64 + type: integer SecurityMonitoringTriageUser: description: Object representing a given user entity. properties: diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/frozen.json index 162911518a98..7c25707aed74 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/frozen.json @@ -1 +1 @@ -"2022-09-19T13:40:09.181Z" +"2022-09-27T13:06:48.381Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/recording.har index 71518f23ba3f..04689b7134c5 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-Bad-Request-response_1398536295/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "3602fe699ca5aac813826a017e5dd9cf", + "_id": "710c4def7bae181d3c01f89a98f7f31e", "_order": 0, "cache": {}, "request": { @@ -32,7 +32,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"cases\":[{\"status\":\"info\"}],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_returns_Bad_Request_response-1663594809\",\"options\":{},\"queries\":[{\"query\":\"\"}],\"tags\":[]}" + "text": "{\"cases\":[{\"status\":\"info\"}],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_returns_Bad_Request_response-1664284008\",\"options\":{},\"queries\":[{\"query\":\"\"}],\"tags\":[]}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" @@ -57,8 +57,8 @@ "status": 400, "statusText": "Bad Request" }, - "startedDateTime": "2022-09-19T13:40:09.188Z", - "time": 472 + "startedDateTime": "2022-09-27T13:06:48.387Z", + "time": 497 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/frozen.json index d54d45885351..9e641bcae588 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/frozen.json @@ -1 +1 @@ -"2022-09-19T11:07:29.388Z" +"2022-09-27T13:06:48.898Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/recording.har index c36ecebe08c9..51a6e4857936 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-returns-OK-response_1993092739/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "e517e698af413b0cd5ecf1e20e34889f", + "_id": "d4eed9faa240134545b6b3a49670f60a", "_order": 0, "cache": {}, "request": { @@ -26,13 +26,13 @@ "value": "application/json" } ], - "headersSize": 586, + "headersSize": 588, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1663585649\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}" + "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1664284008\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" @@ -42,7 +42,7 @@ "content": { "mimeType": "application/json", "size": 592, - "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1663585649754,\"filters\":[],\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"nax-jvc-f8c\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1663585649\"}\n" + "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1664284009174,\"filters\":[],\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"dam-cha-bya\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_returns_OK_response-1664284008\"}\n" }, "cookies": [], "headers": [ @@ -57,11 +57,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-09-19T11:07:29.394Z", - "time": 451 + "startedDateTime": "2022-09-27T13:06:48.903Z", + "time": 994 }, { - "_id": "d6e0a4ec4b43b1d967ce1b35366edc66", + "_id": "e20ed2aa241f7d4638f367cf16240ac3", "_order": 0, "cache": {}, "request": { @@ -74,11 +74,11 @@ "value": "*/*" } ], - "headersSize": 534, + "headersSize": 536, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/nax-jvc-f8c" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/dam-cha-bya" }, "response": { "bodySize": 0, @@ -94,8 +94,8 @@ "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-09-19T11:07:29.854Z", - "time": 596 + "startedDateTime": "2022-09-27T13:06:49.908Z", + "time": 519 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-impossible_travel-returns-OK-response_4217150877/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-impossible_travel-returns-OK-response_4217150877/frozen.json index 2614bb0b7d10..a1abd0c8f1de 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-impossible_travel-returns-OK-response_4217150877/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-impossible_travel-returns-OK-response_4217150877/frozen.json @@ -1 +1 @@ -"2022-05-12T09:53:08.127Z" +"2022-09-27T13:06:50.436Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-impossible_travel-returns-OK-response_4217150877/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-impossible_travel-returns-OK-response_4217150877/recording.har index 94cdd1738339..376e79985eff 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-impossible_travel-returns-OK-response_4217150877/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-impossible_travel-returns-OK-response_4217150877/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "52d2aab8e1e322d3462f72338564819c", + "_id": "56a579bbb44076b012d8c2f7cccdec7a", "_order": 0, "cache": {}, "request": { @@ -32,17 +32,17 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"cases\":[{\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"hasExtendedTitle\":true,\"isEnabled\":true,\"message\":\"test\",\"name\":\"Test-Create_a_detection_rule_with_type_impossible_travel_returns_OK_response-1652349188\",\"options\":{\"detectionMethod\":\"impossible_travel\",\"evaluationWindow\":900,\"impossibleTravelOptions\":{\"baselineUserLocations\":false},\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"geo_data\",\"distinctFields\":[],\"groupByFields\":[\"@usr.id\"],\"metric\":\"@network.client.geoip\",\"query\":\"*\"}],\"tags\":[],\"type\":\"log_detection\"}" + "text": "{\"cases\":[{\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"hasExtendedTitle\":true,\"isEnabled\":true,\"message\":\"test\",\"name\":\"Test-Create_a_detection_rule_with_type_impossible_travel_returns_OK_response-1664284010\",\"options\":{\"detectionMethod\":\"impossible_travel\",\"evaluationWindow\":900,\"impossibleTravelOptions\":{\"baselineUserLocations\":false},\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"geo_data\",\"distinctFields\":[],\"groupByFields\":[\"@usr.id\"],\"metric\":\"@network.client.geoip\",\"query\":\"*\"}],\"tags\":[],\"type\":\"log_detection\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" }, "response": { - "bodySize": 696, + "bodySize": 732, "content": { "mimeType": "application/json", - "size": 696, - "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":true,\"message\":\"test\",\"options\":{\"impossibleTravelOptions\":{\"baselineUserLocations\":false},\"detectionMethod\":\"impossible_travel\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1652349188680,\"filters\":[],\"queries\":[{\"distinctFields\":[],\"name\":\"\",\"metric\":\"@network.client.geoip\",\"aggregation\":\"geo_data\",\"groupByFields\":[\"@usr.id\"],\"query\":\"*\"}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\"}],\"type\":\"log_detection\",\"id\":\"gnq-slf-npc\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_impossible_travel_returns_OK_response-1652349188\"}\n" + "size": 732, + "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":true,\"message\":\"test\",\"options\":{\"impossibleTravelOptions\":{\"baselineUserLocations\":false},\"detectionMethod\":\"impossible_travel\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1664284010816,\"filters\":[],\"queries\":[{\"distinctFields\":[],\"name\":\"\",\"metric\":\"@network.client.geoip\",\"aggregation\":\"geo_data\",\"metrics\":[\"@network.client.geoip\"],\"groupByFields\":[\"@usr.id\"],\"query\":\"*\"}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\"}],\"type\":\"log_detection\",\"id\":\"iat-ydc-4mz\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_impossible_travel_returns_OK_response-1664284010\"}\n" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 627, + "headersSize": 628, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:53:08.129Z", - "time": 657 + "startedDateTime": "2022-09-27T13:06:50.441Z", + "time": 471 }, { - "_id": "1d92975c9154cfc7ff3c12ef06eca923", + "_id": "854892c36376e75851c5a3c3097fd540", "_order": 0, "cache": {}, "request": { @@ -78,7 +78,7 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/gnq-slf-npc" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/iat-ydc-4mz" }, "response": { "bodySize": 0, @@ -94,8 +94,8 @@ "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-05-12T09:53:08.790Z", - "time": 603 + "startedDateTime": "2022-09-27T13:06:50.921Z", + "time": 468 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/frozen.json index 90294141208f..ddd52a4959b4 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/frozen.json @@ -1 +1 @@ -"2022-09-19T10:52:17.321Z" +"2022-09-27T13:06:51.398Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/recording.har index 7f9ce121797a..f14da85fc587 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-signal_correlation-returns-OK-response_3291982082/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "f87379fdda56237a4d013b426800cc74", + "_id": "0bab2d6a2f7deb6d5f712f78b87c1146", "_order": 0, "cache": {}, "request": { @@ -32,7 +32,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}" + "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1664284011\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" @@ -42,7 +42,7 @@ "content": { "mimeType": "application/json", "size": 621, - "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1663584737718,\"filters\":[],\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"wjo-ehv-wku\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737\"}\n" + "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1664284011737,\"filters\":[],\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"bvi-e5q-fw2\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1664284011\"}\n" }, "cookies": [], "headers": [ @@ -57,11 +57,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-09-19T10:52:17.324Z", - "time": 467 + "startedDateTime": "2022-09-27T13:06:51.402Z", + "time": 443 }, { - "_id": "7d3689f4952cd4aa7156733a735db448", + "_id": "09e82e2d3e4dbddcfbf387f4b649a7f2", "_order": 0, "cache": {}, "request": { @@ -85,7 +85,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule Bis\",\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737_bis\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:false\"}],\"tags\":[],\"type\":\"log_detection\"}" + "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule Bis\",\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1664284011_bis\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:false\"}],\"tags\":[],\"type\":\"log_detection\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" @@ -95,7 +95,7 @@ "content": { "mimeType": "application/json", "size": 630, - "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule Bis\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1663584738121,\"filters\":[],\"queries\":[{\"query\":\"@test:false\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"mfw-y8s-dhf\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737_bis\"}\n" + "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule Bis\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1664284012131,\"filters\":[],\"queries\":[{\"query\":\"@test:false\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"iik-vtr-194\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1664284011_bis\"}\n" }, "cookies": [], "headers": [ @@ -110,11 +110,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-09-19T10:52:17.797Z", - "time": 397 + "startedDateTime": "2022-09-27T13:06:51.854Z", + "time": 377 }, { - "_id": "d09dc517f782c1e8ab1f647278675f0f", + "_id": "ff43406b40bc691d1aba9a180646a55f", "_order": 0, "cache": {}, "request": { @@ -138,7 +138,7 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"cases\":[{\"condition\":\"a > 0 && b > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test signal correlation rule\",\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737_signal_rule\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"event_count\",\"correlatedByFields\":[\"host\"],\"correlatedQueryIndex\":1,\"ruleId\":\"wjo-ehv-wku\"},{\"aggregation\":\"event_count\",\"correlatedByFields\":[\"host\"],\"ruleId\":\"mfw-y8s-dhf\"}],\"tags\":[],\"type\":\"signal_correlation\"}" + "text": "{\"cases\":[{\"condition\":\"a > 0 && b > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test signal correlation rule\",\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1664284011_signal_rule\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"event_count\",\"correlatedByFields\":[\"host\"],\"correlatedQueryIndex\":1,\"ruleId\":\"bvi-e5q-fw2\"},{\"aggregation\":\"event_count\",\"correlatedByFields\":[\"host\"],\"ruleId\":\"iik-vtr-194\"}],\"tags\":[],\"type\":\"signal_correlation\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" @@ -148,7 +148,7 @@ "content": { "mimeType": "application/json", "size": 861, - "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test signal correlation rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1663584738582,\"filters\":[],\"queries\":[{\"distinctFields\":[],\"correlatedByFields\":[\"host\"],\"name\":\"\",\"ruleId\":\"wjo-ehv-wku\",\"aggregation\":\"event_count\",\"groupByFields\":[],\"correlatedQueryIndex\":1},{\"distinctFields\":[],\"correlatedByFields\":[\"host\"],\"name\":\"\",\"ruleId\":\"mfw-y8s-dhf\",\"aggregation\":\"event_count\",\"groupByFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0 && b > 0\"}],\"type\":\"signal_correlation\",\"id\":\"rrg-f60-8ru\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1663584737_signal_rule\"}\n" + "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test signal correlation rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1664284012602,\"filters\":[],\"queries\":[{\"distinctFields\":[],\"correlatedByFields\":[\"host\"],\"name\":\"\",\"ruleId\":\"bvi-e5q-fw2\",\"aggregation\":\"event_count\",\"groupByFields\":[],\"correlatedQueryIndex\":1},{\"distinctFields\":[],\"correlatedByFields\":[\"host\"],\"name\":\"\",\"ruleId\":\"iik-vtr-194\",\"aggregation\":\"event_count\",\"groupByFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0 && b > 0\"}],\"type\":\"signal_correlation\",\"id\":\"l1e-bel-iqm\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_signal_correlation_returns_OK_response-1664284011_signal_rule\"}\n" }, "cookies": [], "headers": [ @@ -163,11 +163,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-09-19T10:52:18.200Z", - "time": 468 + "startedDateTime": "2022-09-27T13:06:52.239Z", + "time": 462 }, { - "_id": "9a26068d7557aaf5e9e7eed8f67992a9", + "_id": "0520a0a759e65c08b28f83c9b97a96b9", "_order": 0, "cache": {}, "request": { @@ -184,7 +184,7 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/rrg-f60-8ru" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/l1e-bel-iqm" }, "response": { "bodySize": 0, @@ -200,11 +200,11 @@ "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-09-19T10:52:18.677Z", - "time": 362 + "startedDateTime": "2022-09-27T13:06:52.709Z", + "time": 364 }, { - "_id": "e02b059e65a848ee0b9b90b4122adea3", + "_id": "511b960c1acdf8ef39cf54b0221dde16", "_order": 0, "cache": {}, "request": { @@ -221,7 +221,7 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/mfw-y8s-dhf" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/iik-vtr-194" }, "response": { "bodySize": 0, @@ -237,11 +237,11 @@ "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-09-19T10:52:19.044Z", - "time": 396 + "startedDateTime": "2022-09-27T13:06:53.081Z", + "time": 371 }, { - "_id": "86a6113ab6fa53917139d6661c1754e5", + "_id": "189af9bbc92b0893d71f5680314238ac", "_order": 0, "cache": {}, "request": { @@ -258,7 +258,7 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/wjo-ehv-wku" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/bvi-e5q-fw2" }, "response": { "bodySize": 0, @@ -274,8 +274,8 @@ "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-09-19T10:52:19.443Z", - "time": 462 + "startedDateTime": "2022-09-27T13:06:53.459Z", + "time": 458 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-workload_security-returns-OK-response_733244223/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-workload_security-returns-OK-response_733244223/frozen.json index b4f400733165..117fd6884529 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-workload_security-returns-OK-response_733244223/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-workload_security-returns-OK-response_733244223/frozen.json @@ -1 +1 @@ -"2022-05-12T09:53:09.399Z" +"2022-09-27T13:06:53.927Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-workload_security-returns-OK-response_733244223/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-workload_security-returns-OK-response_733244223/recording.har index c01309b1758b..699b028fb783 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-workload_security-returns-OK-response_733244223/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-detection-rule-with-type-workload_security-returns-OK-response_733244223/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "096345842030ff4de7b0bd6a7d7196e8", + "_id": "33648f8ab9e3458d5ec4307e1e239542", "_order": 0, "cache": {}, "request": { @@ -32,17 +32,17 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_with_type_workload_security_returns_OK_response-1652349189\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"workload_security\"}" + "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Create_a_detection_rule_with_type_workload_security_returns_OK_response-1664284013\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"workload_security\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" }, "response": { - "bodySize": 636, + "bodySize": 624, "content": { "mimeType": "application/json", - "size": 636, - "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1652349190020,\"filters\":[],\"queries\":[{\"distinctFields\":[],\"name\":\"\",\"metric\":\"\",\"aggregation\":\"count\",\"groupByFields\":[],\"query\":\"@test:true\"}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"workload_security\",\"id\":\"zzi-zsq-2is\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_workload_security_returns_OK_response-1652349189\"}\n" + "size": 624, + "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1664284014204,\"filters\":[],\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"workload_security\",\"id\":\"puf-f1v-a1o\",\"isDefault\":false,\"name\":\"Test-Create_a_detection_rule_with_type_workload_security_returns_OK_response-1664284013\"}\n" }, "cookies": [], "headers": [ @@ -57,11 +57,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:53:09.403Z", - "time": 661 + "startedDateTime": "2022-09-27T13:06:53.931Z", + "time": 365 }, { - "_id": "91e8589ba3b38d80834ade2bff525b60", + "_id": "672cefd00feaec5c18a5cb6cd66b984e", "_order": 0, "cache": {}, "request": { @@ -78,7 +78,7 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/zzi-zsq-2is" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/puf-f1v-a1o" }, "response": { "bodySize": 0, @@ -88,14 +88,14 @@ }, "cookies": [], "headers": [], - "headersSize": 575, + "headersSize": 574, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-05-12T09:53:10.071Z", - "time": 699 + "startedDateTime": "2022-09-27T13:06:54.304Z", + "time": 1328 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-security-filter-returns-OK-response_936716052/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Create-a-security-filter-returns-OK-response_936716052/frozen.json index 31abdae5a4bd..792569b321b7 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-security-filter-returns-OK-response_936716052/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-security-filter-returns-OK-response_936716052/frozen.json @@ -1 +1 @@ -"2022-05-12T09:53:10.774Z" +"2022-09-27T13:06:55.640Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Create-a-security-filter-returns-OK-response_936716052/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Create-a-security-filter-returns-OK-response_936716052/recording.har index 526121b05e78..2b70cbe8b28e 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Create-a-security-filter-returns-OK-response_936716052/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Create-a-security-filter-returns-OK-response_936716052/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "fcab5d5074935a83fd79c349a5cc172d", + "_id": "f1e75d1b459ee02d9d6e7133af72790f", "_order": 0, "cache": {}, "request": { @@ -32,36 +32,36 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"data\":{\"attributes\":{\"exclusion_filters\":[{\"name\":\"Exclude staging\",\"query\":\"source:staging\"}],\"filtered_data_type\":\"logs\",\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1652349190\",\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1652349190\"},\"type\":\"security_filters\"}}" + "text": "{\"data\":{\"attributes\":{\"exclusion_filters\":[{\"name\":\"Exclude staging\",\"query\":\"source:staging\"}],\"filtered_data_type\":\"logs\",\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1664284015\",\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1664284015\"},\"type\":\"security_filters\"}}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters" }, "response": { - "bodySize": 362, + "bodySize": 363, "content": { - "mimeType": "application/json;charset=utf-8", - "size": 362, - "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1652349190\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1652349190\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"2co-379-ngs\"}}" + "mimeType": "application/json", + "size": 363, + "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1664284015\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1664284015\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"pde-qfs-vdh\"}}\n" }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json;charset=utf-8" + "value": "application/json" } ], - "headersSize": 713, + "headersSize": 627, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:53:10.776Z", - "time": 569 + "startedDateTime": "2022-09-27T13:06:55.644Z", + "time": 554 }, { - "_id": "84d7c7dc43ca343e4edda64cc510911b", + "_id": "24ba9ebba550b985e464172fbd8a7526", "_order": 0, "cache": {}, "request": { @@ -78,29 +78,29 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/2co-379-ngs" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/pde-qfs-vdh" }, "response": { "bodySize": 0, "content": { - "mimeType": "application/json;charset=utf-8", + "mimeType": "text/html; charset=utf-8", "size": 0 }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json;charset=utf-8" + "value": "text/html; charset=utf-8" } ], - "headersSize": 692, + "headersSize": 614, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-05-12T09:53:11.348Z", - "time": 588 + "startedDateTime": "2022-09-27T13:06:56.205Z", + "time": 381 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Delete-a-security-filter-returns-No-Content-response_1407976675/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Delete-a-security-filter-returns-No-Content-response_1407976675/frozen.json index ef99918a7cd1..fd88e2955285 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Delete-a-security-filter-returns-No-Content-response_1407976675/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Delete-a-security-filter-returns-No-Content-response_1407976675/frozen.json @@ -1 +1 @@ -"2022-05-12T09:53:11.941Z" +"2022-09-27T13:06:56.591Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Delete-a-security-filter-returns-No-Content-response_1407976675/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Delete-a-security-filter-returns-No-Content-response_1407976675/recording.har index d569ba56f591..11034b72ccb2 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Delete-a-security-filter-returns-No-Content-response_1407976675/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Delete-a-security-filter-returns-No-Content-response_1407976675/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "6d29453771380e5e898eeadf65dca561", + "_id": "462065bb720022e0f888c0ea6426b541", "_order": 0, "cache": {}, "request": { @@ -32,36 +32,36 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"data\":{\"attributes\":{\"exclusion_filters\":[{\"name\":\"Exclude logs from staging\",\"query\":\"source:staging\"}],\"filtered_data_type\":\"logs\",\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1652349191\",\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1652349191\"},\"type\":\"security_filters\"}}" + "text": "{\"data\":{\"attributes\":{\"exclusion_filters\":[{\"name\":\"Exclude logs from staging\",\"query\":\"source:staging\"}],\"filtered_data_type\":\"logs\",\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1664284016\",\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1664284016\"},\"type\":\"security_filters\"}}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters" }, "response": { - "bodySize": 387, + "bodySize": 388, "content": { - "mimeType": "application/json;charset=utf-8", - "size": 387, - "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1652349191\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1652349191\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"7zq-iqt-o0r\"}}" + "mimeType": "application/json", + "size": 388, + "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1664284016\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1664284016\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"d9w-8nc-bzo\"}}\n" }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json;charset=utf-8" + "value": "application/json" } ], - "headersSize": 713, + "headersSize": 627, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:53:11.943Z", - "time": 770 + "startedDateTime": "2022-09-27T13:06:56.595Z", + "time": 449 }, { - "_id": "a46273a7a586c4bfd26120b09bcbd753", + "_id": "0fde60e24b28676c0d867b4ba8f6a02b", "_order": 0, "cache": {}, "request": { @@ -78,32 +78,32 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/7zq-iqt-o0r" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/d9w-8nc-bzo" }, "response": { "bodySize": 0, "content": { - "mimeType": "application/json;charset=utf-8", + "mimeType": "text/html; charset=utf-8", "size": 0 }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json;charset=utf-8" + "value": "text/html; charset=utf-8" } ], - "headersSize": 692, + "headersSize": 614, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-05-12T09:53:12.717Z", - "time": 533 + "startedDateTime": "2022-09-27T13:06:57.050Z", + "time": 457 }, { - "_id": "a46273a7a586c4bfd26120b09bcbd753", + "_id": "0fde60e24b28676c0d867b4ba8f6a02b", "_order": 1, "cache": {}, "request": { @@ -120,14 +120,14 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/7zq-iqt-o0r" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/d9w-8nc-bzo" }, "response": { - "bodySize": 73, + "bodySize": 74, "content": { "mimeType": "application/json", - "size": 73, - "text": "{\"errors\":[\"not_found(Security filter with id '7zq-iqt-o0r' not found)\"]}" + "size": 74, + "text": "{\"errors\":[\"not_found(Security filter with id 'd9w-8nc-bzo' not found)\"]}\n" }, "cookies": [], "headers": [ @@ -142,8 +142,8 @@ "status": 404, "statusText": "Not Found" }, - "startedDateTime": "2022-05-12T09:53:13.256Z", - "time": 474 + "startedDateTime": "2022-09-27T13:06:57.515Z", + "time": 391 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Delete-an-existing-rule-returns-OK-response_3829060834/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Delete-an-existing-rule-returns-OK-response_3829060834/frozen.json index cbcbec23ffcd..f6a1ad491238 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Delete-an-existing-rule-returns-OK-response_3829060834/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Delete-an-existing-rule-returns-OK-response_3829060834/frozen.json @@ -1 +1 @@ -"2022-05-12T09:53:13.737Z" +"2022-09-27T13:06:57.917Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Delete-an-existing-rule-returns-OK-response_3829060834/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Delete-an-existing-rule-returns-OK-response_3829060834/recording.har index 1149eb78909c..f97af1b3e4a5 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Delete-an-existing-rule-returns-OK-response_3829060834/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Delete-an-existing-rule-returns-OK-response_3829060834/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "099a214ce7d9450dd5cec31739db551c", + "_id": "45bec8210cad5c34a5d0d02fe18db86b", "_order": 0, "cache": {}, "request": { @@ -32,17 +32,17 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Delete_an_existing_rule_returns_OK_response-1652349193\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}" + "text": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Delete_an_existing_rule_returns_OK_response-1664284017\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metric\":\"\",\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules" }, "response": { - "bodySize": 604, + "bodySize": 592, "content": { "mimeType": "application/json", - "size": 604, - "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1652349194387,\"filters\":[],\"queries\":[{\"distinctFields\":[],\"name\":\"\",\"metric\":\"\",\"aggregation\":\"count\",\"groupByFields\":[],\"query\":\"@test:true\"}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"rsi-g0p-3jz\",\"isDefault\":false,\"name\":\"Test-Delete_an_existing_rule_returns_OK_response-1652349193\"}\n" + "size": 592, + "text": "{\"creationAuthorId\":1445416,\"tags\":[],\"isEnabled\":true,\"hasExtendedTitle\":false,\"message\":\"Test rule\",\"options\":{\"detectionMethod\":\"threshold\",\"evaluationWindow\":900,\"maxSignalDuration\":86400,\"keepAlive\":3600},\"version\":1,\"createdAt\":1664284018198,\"filters\":[],\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"distinctFields\":[]}],\"isDeleted\":false,\"cases\":[{\"status\":\"info\",\"notifications\":[],\"name\":\"\",\"condition\":\"a > 0\"}],\"type\":\"log_detection\",\"id\":\"glg-ejh-8oy\",\"isDefault\":false,\"name\":\"Test-Delete_an_existing_rule_returns_OK_response-1664284017\"}\n" }, "cookies": [], "headers": [ @@ -57,11 +57,11 @@ "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:53:13.739Z", - "time": 694 + "startedDateTime": "2022-09-27T13:06:57.921Z", + "time": 373 }, { - "_id": "b2a223c7a99ab6a6788bbf5dedb0920c", + "_id": "0d38bdcc0a295c427bf65fcbdb6d5012", "_order": 0, "cache": {}, "request": { @@ -78,7 +78,7 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/rsi-g0p-3jz" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/glg-ejh-8oy" }, "response": { "bodySize": 0, @@ -94,11 +94,11 @@ "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-05-12T09:53:14.436Z", - "time": 679 + "startedDateTime": "2022-09-27T13:06:58.303Z", + "time": 419 }, { - "_id": "b2a223c7a99ab6a6788bbf5dedb0920c", + "_id": "0d38bdcc0a295c427bf65fcbdb6d5012", "_order": 1, "cache": {}, "request": { @@ -115,14 +115,14 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/rsi-g0p-3jz" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/rules/glg-ejh-8oy" }, "response": { "bodySize": 60, "content": { "mimeType": "application/json", "size": 60, - "text": "{\"errors\":[\"Threat detection rule not found: rsi-g0p-3jz\"]}\n" + "text": "{\"errors\":[\"Threat detection rule not found: glg-ejh-8oy\"]}\n" }, "cookies": [], "headers": [ @@ -137,8 +137,8 @@ "status": 404, "statusText": "Not Found" }, - "startedDateTime": "2022-05-12T09:53:15.119Z", - "time": 492 + "startedDateTime": "2022-09-27T13:06:58.729Z", + "time": 383 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-a-security-filter-returns-OK-response_2584323750/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Get-a-security-filter-returns-OK-response_2584323750/frozen.json index 552bbf5266f8..3654b980fcdd 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Get-a-security-filter-returns-OK-response_2584323750/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-a-security-filter-returns-OK-response_2584323750/frozen.json @@ -1 +1 @@ -"2022-05-12T09:53:15.617Z" +"2022-09-27T13:06:59.124Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-a-security-filter-returns-OK-response_2584323750/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Get-a-security-filter-returns-OK-response_2584323750/recording.har index f54143220538..666c45274f63 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Get-a-security-filter-returns-OK-response_2584323750/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-a-security-filter-returns-OK-response_2584323750/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "1b6a287e4ed95dafe7e9a7202bcafd50", + "_id": "495c21a2f00e46e767b163c326ff3c2a", "_order": 0, "cache": {}, "request": { @@ -32,36 +32,36 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"data\":{\"attributes\":{\"exclusion_filters\":[{\"name\":\"Exclude logs from staging\",\"query\":\"source:staging\"}],\"filtered_data_type\":\"logs\",\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1652349195\",\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1652349195\"},\"type\":\"security_filters\"}}" + "text": "{\"data\":{\"attributes\":{\"exclusion_filters\":[{\"name\":\"Exclude logs from staging\",\"query\":\"source:staging\"}],\"filtered_data_type\":\"logs\",\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1664284019\",\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1664284019\"},\"type\":\"security_filters\"}}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters" }, "response": { - "bodySize": 366, + "bodySize": 367, "content": { - "mimeType": "application/json;charset=utf-8", - "size": 366, - "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1652349195\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1652349195\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"lgh-q3c-xlh\"}}" + "mimeType": "application/json", + "size": 367, + "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1664284019\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1664284019\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"iy5-coy-b9b\"}}\n" }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json;charset=utf-8" + "value": "application/json" } ], - "headersSize": 713, + "headersSize": 627, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:53:15.619Z", - "time": 594 + "startedDateTime": "2022-09-27T13:06:59.127Z", + "time": 436 }, { - "_id": "e580e4707e8a72ad9591ac3b7ad619ef", + "_id": "4e8cebf1a4a1f1602795f079c71fbe5c", "_order": 0, "cache": {}, "request": { @@ -78,33 +78,33 @@ "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/lgh-q3c-xlh" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/iy5-coy-b9b" }, "response": { - "bodySize": 366, + "bodySize": 367, "content": { - "mimeType": "application/json;charset=utf-8", - "size": 366, - "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1652349195\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1652349195\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"lgh-q3c-xlh\"}}" + "mimeType": "application/json", + "size": 367, + "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1664284019\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1664284019\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"iy5-coy-b9b\"}}\n" }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json;charset=utf-8" + "value": "application/json" } ], - "headersSize": 713, + "headersSize": 627, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:53:16.217Z", - "time": 435 + "startedDateTime": "2022-09-27T13:06:59.568Z", + "time": 358 }, { - "_id": "66069e3767e4def479224be266ae8ec8", + "_id": "4365d15830d5a6365af7b2937bd2b3d3", "_order": 0, "cache": {}, "request": { @@ -121,29 +121,29 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/lgh-q3c-xlh" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/iy5-coy-b9b" }, "response": { "bodySize": 0, "content": { - "mimeType": "application/json;charset=utf-8", + "mimeType": "text/html; charset=utf-8", "size": 0 }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json;charset=utf-8" + "value": "text/html; charset=utf-8" } ], - "headersSize": 692, + "headersSize": 615, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-05-12T09:53:16.657Z", - "time": 436 + "startedDateTime": "2022-09-27T13:06:59.933Z", + "time": 360 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-all-security-filters-returns-OK-response_358816047/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Get-all-security-filters-returns-OK-response_358816047/frozen.json index afc4aaa00813..b6d471b7955d 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Get-all-security-filters-returns-OK-response_358816047/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-all-security-filters-returns-OK-response_358816047/frozen.json @@ -1 +1 @@ -"2022-01-06T00:52:13.157Z" +"2022-09-27T13:07:00.301Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Get-all-security-filters-returns-OK-response_358816047/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Get-all-security-filters-returns-OK-response_358816047/recording.har index aaaf34446a93..b630a79f9bfe 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Get-all-security-filters-returns-OK-response_358816047/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Get-all-security-filters-returns-OK-response_358816047/recording.har @@ -21,34 +21,34 @@ "value": "application/json" } ], - "headersSize": 466, + "headersSize": 550, "httpVersion": "HTTP/1.1", "method": "GET", "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters" }, "response": { - "bodySize": 80928, + "bodySize": 102338, "content": { - "mimeType": "application/json;charset=utf-8", - "size": 80928, - "text": "{\"data\":[{\"attributes\":{\"is_enabled\":true,\"name\":\"all ingested logs\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":1,\"query\":\"*\",\"is_builtin\":true},\"type\":\"security_filters\",\"id\":\"bc0-fow-e4j\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Custom security filter\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:api\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qhn-iuy-4oc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"tf-TestAccDatadogSecurityMonitoringFilter-local-1626096168\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"does not really match much\",\"name\":\"first\"},{\"query\":\"neither does it\",\"name\":\"second\"}],\"version\":1,\"query\":\"acceptance rule triggered\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"7no-kjl-tnb\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"tf-TestAccDatadogSecurityMonitoringFilterDatasource-local-1626104534\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"does not really match much\",\"name\":\"first\"},{\"query\":\"neither does it\",\"name\":\"second\"}],\"version\":1,\"query\":\"ayayay query\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"smf-png-gzf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1631884327\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1631884327\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"hrp-l2l-xht\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1631884338\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1631884338\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"zr7-kgu-adi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1631884338\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1631884338\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wbd-e2v-yke\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1631884454\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1631884454\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tek-udt-1ad\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1631884464\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1631884464\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ctr-nal-eek\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1631884465\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1631884465\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jpx-aky-hgq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1631884670\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1631884670\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"otn-2vv-0xe\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1631884674\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1631884674\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"knf-be5-bhz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1631884674\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1631884674\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rjt-omi-ece\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1631884714\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1631884714\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ebq-o3v-gdg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1631884715\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1631884715\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0pz-qyq-kqq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1631884725\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1631884725\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"m9g-ncc-02a\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Delete_a_security_filter_returns_No_Content_response-1631886017\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1631886017\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"s8y-ndo-pmo\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Get_a_security_filter_returns_OK_response-1631886029\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonGetasecurityfilterreturnsOKresponse1631886029\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"clz-vl4-04z\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Update_a_security_filter_returns_OK_response-1631886034\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonUpdateasecurityfilterreturnsOKresponse1631886034\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ind-p9s-w9j\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632817310\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632817310\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"opx-q1v-ckn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632817310\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632817310\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"4mz-na2-ozw\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632817311\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632817311\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tkf-gkv-ffv\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632820231\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632820231\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"x1a-p97-scf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632820231\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632820231\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"g85-tm8-yhe\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632820232\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632820232\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"obh-5cb-a0j\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632820436\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632820436\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3cw-wzf-nsn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632820437\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632820437\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"a2c-940-8x8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632820438\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632820438\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"r8h-dyg-wgf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632821203\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632821203\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"eum-bss-dyi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632821205\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632821205\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"6wj-zed-jv3\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632821205\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632821205\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"hbn-bix-9ia\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632821494\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632821494\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"paz-gwc-z4l\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632821495\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632821495\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jce-5qr-qdy\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632821495\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632821495\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bpr-rhq-xqj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632824855\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632824855\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"swf-vch-g9h\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632824856\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632824856\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wtp-76p-ghf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632824857\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632824857\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ogc-yrs-p4p\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632826434\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632826434\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"y08-eup-05l\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632826436\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632826436\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wkz-wad-cbl\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632826436\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632826436\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"9kl-ojt-pmy\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632827408\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632827408\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"dh2-zr8-lam\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632827409\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632827409\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"hho-vt6-tws\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632827410\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632827410\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ltk-chn-umu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632828993\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632828993\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"q3f-vnn-qmh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632828993\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632828993\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"pvi-byz-som\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632828994\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632828994\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3zg-jqc-ftm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632832892\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632832892\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"kpj-t46-vbn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632832892\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632832892\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0og-l8j-tsq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632832893\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632832893\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jea-me2-ru1\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632833158\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632833158\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"04n-hit-fum\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632833159\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632833159\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3rw-stk-rtz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632833159\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632833159\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"zwb-63t-lpu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632836449\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632836449\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"vle-9cs-xlh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632836451\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632836451\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"82v-knv-p8b\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632836452\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632836452\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jp2-7ys-ljn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632839530\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839530\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"up5-dkc-sbq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632839530\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839530\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"viv-6rl-zxw\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632839530\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839530\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1ls-1xt-i8c\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632839555\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839555\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0bv-ryy-bup\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632839556\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839556\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wuj-q1l-beq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632839557\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839557\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"usl-avk-v1a\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632839754\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839754\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cdu-xnm-7k9\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632839755\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839755\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"dpq-4bx-fj2\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632839755\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839755\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cnt-1qa-1xp\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632841163\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632841163\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"htl-cat-7ye\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632841164\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632841164\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"zw3-fsy-7bh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632841165\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632841165\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mwa-jkd-mg6\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632842479\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632842479\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3ph-ztk-l8m\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632842482\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632842482\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0lr-30a-qe8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632842482\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632842482\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"b57-68u-t1d\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632843068\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632843068\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"46n-cov-z4x\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632843069\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632843069\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"57n-tai-vbl\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632843069\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632843069\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"elu-n9r-zdk\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632844019\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632844019\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1rg-ja2-wc7\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632844020\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632844020\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"9sk-plb-lbm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632844021\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632844021\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"33b-4ut-ydc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632844135\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632844135\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wzw-cyw-og7\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632844135\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632844135\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"vjk-qik-jdi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632844135\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632844135\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qun-iu6-n5g\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632846637\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632846637\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"lbv-ghg-b4a\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632846638\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632846638\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"etu-tzk-p4y\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632846639\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632846639\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"xgg-32m-9um\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632847599\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632847599\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ysc-uz9-oct\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632847600\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632847600\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"j6p-hzw-4gg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632847601\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632847601\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"9zj-osj-io8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632848092\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848092\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bn2-ytq-ezm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632848094\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848094\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"oz0-0sv-86g\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632848095\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848095\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"dwk-qj9-kgd\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632848450\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848450\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jxw-wxr-tnx\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632848451\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848451\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"sto-gxf-iy1\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632848451\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848451\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"lol-5bi-6ik\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632848885\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848885\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tnk-8wf-v5c\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632848885\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848885\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"hfa-dvd-bf1\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632848886\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848886\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cwp-o1a-zwo\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632849681\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632849681\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"f4c-bee-wyi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632849683\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632849683\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"caf-zh1-vqf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632849684\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632849684\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"8pn-vrw-kn4\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632849896\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632849896\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wh3-wcd-shk\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632849897\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632849897\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"6or-pfc-jsh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632849898\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632849898\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"atx-t02-qhu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632851126\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632851126\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mqn-ec8-cys\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632851127\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632851127\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"er4-rot-i9q\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632851128\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632851128\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"7av-rff-z31\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632888517\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632888517\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1xt-hsv-seu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632888518\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632888518\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rwh-ge7-poj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632888518\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632888518\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"xxy-a4m-alu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632898979\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632898979\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ple-dse-hhf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632898980\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632898980\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"xix-4vr-abm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632898980\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632898980\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"l8o-bzf-1fs\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632899193\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632899193\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ovk-9mh-i7q\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632899194\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632899194\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"z15-wxx-yix\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632899194\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632899194\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ewr-qfb-hvx\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632902893\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632902893\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jqo-9hq-3hz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632902894\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632902894\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"nv8-a6r-uzu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632902894\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632902894\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"2zl-irh-u4x\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632903483\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632903483\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ove-4eu-ocg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632903484\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632903484\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wme-icd-q9j\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632903485\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632903485\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mlu-006-hhl\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632904028\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632904028\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qyd-yxv-qtf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632904028\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632904028\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cdy-aqo-nos\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632904029\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632904029\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"nzp-j5a-jrb\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632907319\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632907319\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"w9b-vfx-oqz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632907320\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632907320\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wxm-54b-g9v\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632907320\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632907320\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tqo-alk-oww\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632907341\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632907341\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"epg-zdn-8o4\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632907342\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632907342\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bw7-nje-vtb\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632907342\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632907342\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qaf-z5b-da7\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632908400\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632908400\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"r6d-4kz-mch\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632908401\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632908401\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"dar-afy-68w\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632908402\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632908402\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mzl-r2s-3d3\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632909893\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632909893\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"amk-yqc-2jg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632909895\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632909895\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jvp-lye-omw\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632909896\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632909896\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mky-7xe-w96\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632910740\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632910740\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cpn-5xa-qvr\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632910741\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632910741\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"gnd-qai-263\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632910742\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632910742\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"may-03m-8gc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632913811\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632913811\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3wl-tn0-g3p\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632913813\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632913813\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"kmc-6co-0xq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632913814\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632913814\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cke-k5o-udo\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632918181\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632918181\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"g0n-ynp-vuj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632918181\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632918181\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"unp-wrp-w6s\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632918182\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632918182\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ek7-jqe-hab\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632919352\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632919352\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cza-so4-7se\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632919352\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632919352\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"lxy-qgf-rdw\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632919353\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632919353\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0h6-4bl-gyy\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632919567\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632919567\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"j8u-cox-47o\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632919568\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632919568\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wpj-eon-hhq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632919568\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632919568\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"gzy-dxq-y8c\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632921868\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632921868\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1vw-prp-da3\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632921868\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632921868\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cz9-r0k-77v\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632921869\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632921869\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"unn-qpz-hwg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632922202\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632922202\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"70w-v06-tzj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632922203\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632922203\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"a66-7u7-nad\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632922203\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632922203\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"d2p-7v7-avd\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632928250\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632928250\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"fgk-oxj-ftk\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632928250\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632928250\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"fpp-xqi-uu9\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632928251\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632928251\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"63r-qez-ybq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632933845\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632933845\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"gju-kit-iw5\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632933846\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632933846\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1m4-2co-rpk\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632933847\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632933847\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tir-l97-lp0\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632974965\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632974965\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ogv-c35-zyi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632974966\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632974966\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mvz-r9p-fbq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632974966\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632974966\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tbf-w69-aty\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632986086\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632986086\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"xzl-grv-7gm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632986087\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632986087\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jku-q85-vzi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632986087\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632986087\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"awi-wik-sqv\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632989757\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632989757\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"zxt-ben-do9\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632989758\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632989758\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ir8-h43-r0a\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632989758\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632989758\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"erz-srb-bn8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632997311\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632997311\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"r75-jsq-jpu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632997312\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632997312\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qq6-jjy-3tu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632997312\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632997312\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tsp-qrn-n9x\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633000142\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633000142\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"4yc-4ge-ghb\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633000144\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633000144\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bed-vic-suh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633000145\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633000145\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"put-2jd-2ib\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633003795\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633003795\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"y8f-naf-1cj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633003796\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633003796\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1pt-6xr-7ic\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633003797\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633003797\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rpo-lwd-fyr\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633004068\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633004068\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"euk-m8d-p2d\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633004069\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633004069\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"nhm-rho-ez9\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633004069\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633004069\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"zuo-60q-xbh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633006704\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633006704\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3db-tgu-ays\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633006704\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633006704\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"6ou-tsb-hlx\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633006705\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633006705\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ojr-mg7-oke\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633007542\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633007542\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"znq-ano-djg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633007542\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633007542\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"kmo-hwd-qq2\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633007543\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633007543\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"v8u-jjs-9vc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633011104\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633011104\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ld0-njn-zw1\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633011105\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633011105\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"w8u-g2z-xy8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633011105\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633011105\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mh9-5yo-qq2\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633011244\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633011244\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"vac-obe-n22\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633011246\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633011246\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mpc-glp-h7w\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633011247\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633011247\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qwx-au5-zve\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633015449\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633015449\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"saa-vzr-xsj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633015451\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633015451\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"pfl-vim-gje\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633015452\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633015452\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"2uh-zo8-nb5\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Ruby-Get_a_security_filter_returns_OK_response-1634150224\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestRubyGetasecurityfilterreturnsOKresponse1634150224\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"egl-poh-kzn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Get_a_security_filter_returns_OK_response-1635496812\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonGetasecurityfilterreturnsOKresponse1635496812\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"gcz-3rz-y1w\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Go-Get_a_security_filter_returns_OK_response-1636410254\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGoGetasecurityfilterreturnsOKresponse1636410254\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"csu-jez-ive\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1637063344\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1637063344\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"izh-ced-qmc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1637063346\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1637063346\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rtp-twm-nur\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1637063347\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1637063347\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rin-h1e-8p1\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1637070528\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1637070528\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"thp-jp7-1is\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1637070533\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1637070533\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jyk-ryj-r5v\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1637070535\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1637070535\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"5hn-7yt-vcx\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1637077967\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1637077967\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"vjx-2ei-qzt\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1637077969\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1637077969\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"trb-gqz-rw0\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1637077970\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1637077970\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"eam-ucg-ysc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1637078478\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1637078478\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"nd2-4uw-ryq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1637078481\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1637078481\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mdt-vr8-lpi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1637078482\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1637078482\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0rq-mvi-cgj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1637089241\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1637089241\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wn3-as7-moa\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1620751633\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1620751633\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tqw-xay-uyv\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1620751634\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1620751634\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"5zc-uho-3kh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1637141213\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1637141213\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"auv-76t-trj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1637141215\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1637141215\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"d4t-p2p-tsw\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1637141217\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1637141217\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"vpi-vz6-pnj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Ruby-Get_a_security_filter_returns_OK_response-1637834808\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestRubyGetasecurityfilterreturnsOKresponse1637834808\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"eaa-jqt-qhz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Get_a_security_filter_returns_OK_response-1638987050\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonGetasecurityfilterreturnsOKresponse1638987050\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rpt-0pp-r8j\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Delete_a_security_filter_returns_No_Content_response-1638987054\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1638987054\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bkx-gg1-qlx\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Update_a_security_filter_returns_OK_response-1638987055\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonUpdateasecurityfilterreturnsOKresponse1638987055\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"z67-o7h-hik\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Create_a_security_filter_returns_OK_response-1638987057\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestPythonCreateasecurityfilterreturnsOKresponse1638987057\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mlx-awu-wg9\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Delete_a_security_filter_returns_No_Content_response-1639574360\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1639574360\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ugq-7e0-rmg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1640111630\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1640111630\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"iue-buv-ynq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1640112776\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1640112776\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qqm-ssh-ees\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1640112926\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1640112926\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"lkt-tz2-dfx\"}]}" + "mimeType": "application/json", + "size": 102338, + "text": "{\"data\":[{\"attributes\":{\"is_enabled\":true,\"name\":\"all ingested logs\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":1,\"query\":\"*\",\"is_builtin\":true},\"type\":\"security_filters\",\"id\":\"bc0-fow-e4j\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Custom security filter\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:api\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qhn-iuy-4oc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"tf-TestAccDatadogSecurityMonitoringFilter-local-1626096168\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"does not really match much\",\"name\":\"first\"},{\"query\":\"neither does it\",\"name\":\"second\"}],\"version\":1,\"query\":\"acceptance rule triggered\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"7no-kjl-tnb\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"tf-TestAccDatadogSecurityMonitoringFilterDatasource-local-1626104534\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"does not really match much\",\"name\":\"first\"},{\"query\":\"neither does it\",\"name\":\"second\"}],\"version\":1,\"query\":\"ayayay query\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"smf-png-gzf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1631884327\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1631884327\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"hrp-l2l-xht\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1631884338\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1631884338\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"zr7-kgu-adi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1631884338\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1631884338\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wbd-e2v-yke\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1631884454\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1631884454\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tek-udt-1ad\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1631884464\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1631884464\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ctr-nal-eek\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1631884465\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1631884465\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jpx-aky-hgq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1631884670\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1631884670\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"otn-2vv-0xe\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1631884674\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1631884674\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"knf-be5-bhz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1631884674\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1631884674\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rjt-omi-ece\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1631884714\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1631884714\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ebq-o3v-gdg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1631884715\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1631884715\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0pz-qyq-kqq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1631884725\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1631884725\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"m9g-ncc-02a\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Delete_a_security_filter_returns_No_Content_response-1631886017\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1631886017\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"s8y-ndo-pmo\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Get_a_security_filter_returns_OK_response-1631886029\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonGetasecurityfilterreturnsOKresponse1631886029\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"clz-vl4-04z\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Update_a_security_filter_returns_OK_response-1631886034\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonUpdateasecurityfilterreturnsOKresponse1631886034\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ind-p9s-w9j\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632817310\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632817310\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"opx-q1v-ckn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632817310\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632817310\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"4mz-na2-ozw\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632817311\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632817311\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tkf-gkv-ffv\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632820231\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632820231\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"x1a-p97-scf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632820231\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632820231\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"g85-tm8-yhe\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632820232\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632820232\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"obh-5cb-a0j\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632820436\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632820436\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3cw-wzf-nsn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632820437\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632820437\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"a2c-940-8x8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632820438\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632820438\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"r8h-dyg-wgf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632821203\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632821203\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"eum-bss-dyi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632821205\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632821205\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"6wj-zed-jv3\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632821205\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632821205\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"hbn-bix-9ia\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632821494\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632821494\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"paz-gwc-z4l\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632821495\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632821495\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jce-5qr-qdy\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632821495\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632821495\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bpr-rhq-xqj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632824855\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632824855\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"swf-vch-g9h\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632824856\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632824856\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wtp-76p-ghf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632824857\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632824857\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ogc-yrs-p4p\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632826434\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632826434\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"y08-eup-05l\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632826436\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632826436\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wkz-wad-cbl\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632826436\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632826436\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"9kl-ojt-pmy\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632827408\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632827408\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"dh2-zr8-lam\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632827409\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632827409\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"hho-vt6-tws\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632827410\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632827410\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ltk-chn-umu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632828993\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632828993\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"q3f-vnn-qmh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632828993\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632828993\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"pvi-byz-som\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632828994\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632828994\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3zg-jqc-ftm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632832892\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632832892\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"kpj-t46-vbn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632832892\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632832892\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0og-l8j-tsq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632832893\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632832893\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jea-me2-ru1\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632833158\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632833158\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"04n-hit-fum\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632833159\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632833159\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3rw-stk-rtz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632833159\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632833159\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"zwb-63t-lpu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632836449\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632836449\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"vle-9cs-xlh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632836451\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632836451\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"82v-knv-p8b\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632836452\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632836452\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jp2-7ys-ljn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632839530\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839530\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"up5-dkc-sbq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632839530\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839530\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"viv-6rl-zxw\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632839530\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839530\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1ls-1xt-i8c\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632839555\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839555\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0bv-ryy-bup\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632839556\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839556\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wuj-q1l-beq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632839557\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839557\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"usl-avk-v1a\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632839754\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632839754\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cdu-xnm-7k9\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632839755\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632839755\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"dpq-4bx-fj2\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632839755\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632839755\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cnt-1qa-1xp\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632841163\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632841163\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"htl-cat-7ye\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632841164\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632841164\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"zw3-fsy-7bh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632841165\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632841165\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mwa-jkd-mg6\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632842479\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632842479\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3ph-ztk-l8m\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632842482\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632842482\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0lr-30a-qe8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632842482\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632842482\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"b57-68u-t1d\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632843068\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632843068\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"46n-cov-z4x\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632843069\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632843069\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"57n-tai-vbl\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632843069\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632843069\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"elu-n9r-zdk\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632844019\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632844019\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1rg-ja2-wc7\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632844020\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632844020\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"9sk-plb-lbm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632844021\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632844021\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"33b-4ut-ydc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632844135\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632844135\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wzw-cyw-og7\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632844135\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632844135\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"vjk-qik-jdi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632844135\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632844135\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qun-iu6-n5g\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632846637\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632846637\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"lbv-ghg-b4a\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632846638\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632846638\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"etu-tzk-p4y\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632846639\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632846639\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"xgg-32m-9um\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632847599\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632847599\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ysc-uz9-oct\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632847600\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632847600\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"j6p-hzw-4gg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632847601\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632847601\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"9zj-osj-io8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632848092\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848092\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bn2-ytq-ezm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632848094\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848094\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"oz0-0sv-86g\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632848095\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848095\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"dwk-qj9-kgd\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632848450\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848450\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jxw-wxr-tnx\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632848451\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848451\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"sto-gxf-iy1\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632848451\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848451\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"lol-5bi-6ik\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632848885\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632848885\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tnk-8wf-v5c\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632848885\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632848885\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"hfa-dvd-bf1\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632848886\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632848886\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cwp-o1a-zwo\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632849681\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632849681\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"f4c-bee-wyi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632849683\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632849683\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"caf-zh1-vqf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632849684\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632849684\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"8pn-vrw-kn4\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632849896\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632849896\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wh3-wcd-shk\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632849897\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632849897\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"6or-pfc-jsh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632849898\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632849898\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"atx-t02-qhu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632851126\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632851126\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mqn-ec8-cys\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632851127\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632851127\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"er4-rot-i9q\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632851128\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632851128\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"7av-rff-z31\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632888517\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632888517\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1xt-hsv-seu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632888518\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632888518\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rwh-ge7-poj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632888518\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632888518\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"xxy-a4m-alu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632898979\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632898979\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ple-dse-hhf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632898980\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632898980\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"xix-4vr-abm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632898980\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632898980\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"l8o-bzf-1fs\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632899193\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632899193\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ovk-9mh-i7q\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632899194\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632899194\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"z15-wxx-yix\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632899194\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632899194\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ewr-qfb-hvx\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632902893\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632902893\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jqo-9hq-3hz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632902894\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632902894\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"nv8-a6r-uzu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632902894\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632902894\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"2zl-irh-u4x\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632903483\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632903483\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ove-4eu-ocg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632903484\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632903484\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wme-icd-q9j\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632903485\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632903485\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mlu-006-hhl\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632904028\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632904028\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qyd-yxv-qtf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632904028\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632904028\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cdy-aqo-nos\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632904029\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632904029\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"nzp-j5a-jrb\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632907319\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632907319\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"w9b-vfx-oqz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632907320\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632907320\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wxm-54b-g9v\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632907320\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632907320\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tqo-alk-oww\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632907341\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632907341\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"epg-zdn-8o4\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632907342\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632907342\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bw7-nje-vtb\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632907342\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632907342\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qaf-z5b-da7\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632908400\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632908400\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"r6d-4kz-mch\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632908401\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632908401\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"dar-afy-68w\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632908402\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632908402\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mzl-r2s-3d3\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632909893\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632909893\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"amk-yqc-2jg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632909895\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632909895\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jvp-lye-omw\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632909896\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632909896\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mky-7xe-w96\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632910740\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632910740\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cpn-5xa-qvr\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632910741\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632910741\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"gnd-qai-263\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632910742\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632910742\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"may-03m-8gc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632913811\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632913811\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3wl-tn0-g3p\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632913813\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632913813\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"kmc-6co-0xq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632913814\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632913814\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cke-k5o-udo\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632918181\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632918181\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"g0n-ynp-vuj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632918181\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632918181\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"unp-wrp-w6s\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632918182\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632918182\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ek7-jqe-hab\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632919352\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632919352\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cza-so4-7se\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632919352\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632919352\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"lxy-qgf-rdw\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632919353\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632919353\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0h6-4bl-gyy\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632919567\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632919567\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"j8u-cox-47o\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632919568\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632919568\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wpj-eon-hhq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632919568\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632919568\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"gzy-dxq-y8c\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632921868\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632921868\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1vw-prp-da3\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632921868\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632921868\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cz9-r0k-77v\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632921869\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632921869\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"unn-qpz-hwg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632922202\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632922202\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"70w-v06-tzj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632922203\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632922203\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"a66-7u7-nad\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632922203\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632922203\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"d2p-7v7-avd\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632928250\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632928250\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"fgk-oxj-ftk\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632928250\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632928250\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"fpp-xqi-uu9\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632928251\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632928251\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"63r-qez-ybq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632933845\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632933845\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"gju-kit-iw5\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632933846\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632933846\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1m4-2co-rpk\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632933847\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632933847\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tir-l97-lp0\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632974965\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632974965\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ogv-c35-zyi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632974966\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632974966\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mvz-r9p-fbq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632974966\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632974966\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tbf-w69-aty\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632986086\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632986086\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"xzl-grv-7gm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632986087\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632986087\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jku-q85-vzi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632986087\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632986087\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"awi-wik-sqv\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632989757\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632989757\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"zxt-ben-do9\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632989758\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632989758\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ir8-h43-r0a\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632989758\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632989758\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"erz-srb-bn8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1632997311\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1632997311\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"r75-jsq-jpu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1632997312\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1632997312\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qq6-jjy-3tu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1632997312\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1632997312\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tsp-qrn-n9x\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633000142\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633000142\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"4yc-4ge-ghb\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633000144\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633000144\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bed-vic-suh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633000145\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633000145\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"put-2jd-2ib\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633003795\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633003795\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"y8f-naf-1cj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633003796\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633003796\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1pt-6xr-7ic\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633003797\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633003797\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rpo-lwd-fyr\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633004068\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633004068\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"euk-m8d-p2d\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633004069\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633004069\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"nhm-rho-ez9\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633004069\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633004069\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"zuo-60q-xbh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633006704\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633006704\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3db-tgu-ays\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633006704\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633006704\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"6ou-tsb-hlx\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633006705\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633006705\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ojr-mg7-oke\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633007542\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633007542\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"znq-ano-djg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633007542\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633007542\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"kmo-hwd-qq2\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633007543\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633007543\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"v8u-jjs-9vc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633011104\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633011104\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ld0-njn-zw1\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633011105\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633011105\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"w8u-g2z-xy8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633011105\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633011105\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mh9-5yo-qq2\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633011244\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633011244\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"vac-obe-n22\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633011246\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633011246\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mpc-glp-h7w\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633011247\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633011247\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qwx-au5-zve\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1633015449\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1633015449\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"saa-vzr-xsj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1633015451\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1633015451\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"pfl-vim-gje\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1633015452\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1633015452\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"2uh-zo8-nb5\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Ruby-Get_a_security_filter_returns_OK_response-1634150224\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestRubyGetasecurityfilterreturnsOKresponse1634150224\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"egl-poh-kzn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Get_a_security_filter_returns_OK_response-1635496812\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonGetasecurityfilterreturnsOKresponse1635496812\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"gcz-3rz-y1w\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Go-Get_a_security_filter_returns_OK_response-1636410254\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGoGetasecurityfilterreturnsOKresponse1636410254\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"csu-jez-ive\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1637063344\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1637063344\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"izh-ced-qmc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1637063346\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1637063346\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rtp-twm-nur\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1637063347\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1637063347\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rin-h1e-8p1\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1637070528\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1637070528\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"thp-jp7-1is\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1637070533\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1637070533\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jyk-ryj-r5v\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1637070535\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1637070535\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"5hn-7yt-vcx\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1637077967\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1637077967\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"vjx-2ei-qzt\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1637077969\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1637077969\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"trb-gqz-rw0\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1637077970\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1637077970\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"eam-ucg-ysc\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1637078478\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1637078478\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"nd2-4uw-ryq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1637078481\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1637078481\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mdt-vr8-lpi\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1637078482\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1637078482\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0rq-mvi-cgj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1637089241\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1637089241\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wn3-as7-moa\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1620751633\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1620751633\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tqw-xay-uyv\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1620751634\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1620751634\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"5zc-uho-3kh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1637141213\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1637141213\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"auv-76t-trj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Get_a_security_filter_returns_OK_response-1637141215\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestGetasecurityfilterreturnsOKresponse1637141215\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"d4t-p2p-tsw\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1637141217\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1637141217\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"vpi-vz6-pnj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Ruby-Get_a_security_filter_returns_OK_response-1637834808\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestRubyGetasecurityfilterreturnsOKresponse1637834808\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"eaa-jqt-qhz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Get_a_security_filter_returns_OK_response-1638987050\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonGetasecurityfilterreturnsOKresponse1638987050\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"rpt-0pp-r8j\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Delete_a_security_filter_returns_No_Content_response-1638987054\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1638987054\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bkx-gg1-qlx\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Update_a_security_filter_returns_OK_response-1638987055\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonUpdateasecurityfilterreturnsOKresponse1638987055\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"z67-o7h-hik\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Create_a_security_filter_returns_OK_response-1638987057\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestPythonCreateasecurityfilterreturnsOKresponse1638987057\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"mlx-awu-wg9\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Python-Delete_a_security_filter_returns_No_Content_response-1639574360\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestPythonDeleteasecurityfilterreturnsNoContentresponse1639574360\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ugq-7e0-rmg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1640111630\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1640111630\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"iue-buv-ynq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1640112776\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1640112776\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"qqm-ssh-ees\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Create_a_security_filter_returns_OK_response-1640112926\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestCreateasecurityfilterreturnsOKresponse1640112926\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"lkt-tz2-dfx\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Create_a_security_filter_returns_OK_response_1641598933\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:ExampleCreateasecurityfilterreturnsOKresponse1641598933\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"6wk-p8j-nva\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Create_a_security_filter_returns_OK_response_1642578134\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:ExampleCreateasecurityfilterreturnsOKresponse1642578134\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"u3y-nyf-jrw\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Example-Get_a_security_filter_returns_OK_response_1642733138\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestExampleGetasecurityfilterreturnsOKresponse1642733138\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ida-nab-cke\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1642756664\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1642756664\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"nrq-ogf-weh\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Delete_a_security_filter_returns_No_Content_response-1642756664\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1642756664\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wjw-gsa-lco\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1642756664\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1642756664\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"szy-pir-e5u\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1642756664\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1642756664\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"2j4-1re-xff\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1643209589\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1643209589\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ume-uzk-eeu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1643950965\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1643950965\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"xxp-5gs-gkf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Create_a_security_filter_returns_OK_response_1644339764\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:ExampleCreateasecurityfilterreturnsOKresponse1644339764\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tpm-eoz-ncm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1644382966\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1644382966\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"j5u-vkc-zds\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1644656566\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1644656566\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"zei-o6m-bn0\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Create_a_security_filter_returns_OK_response_1644685366\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:ExampleCreateasecurityfilterreturnsOKresponse1644685366\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"hvw-9ht-lqu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1645102964\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1645102964\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bi8-u6v-oui\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1645131764\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1645131764\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"stc-afy-nwg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1645534965\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1645534965\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"h5u-icu-fqd\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1645664565\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1645664565\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jyg-usk-txn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1647162167\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1647162167\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jvg-rer-he8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Create_a_security_filter_returns_OK_response_1647651765\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:ExampleCreateasecurityfilterreturnsOKresponse1647651765\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"eww-jo3-dul\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1647954164\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1647954164\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"amj-hdv-cyu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Create_a_security_filter_returns_OK_response_1648170165\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:ExampleCreateasecurityfilterreturnsOKresponse1648170165\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"fi7-mmy-9oq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Create_a_security_filter_returns_OK_response_1648270965\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:ExampleCreateasecurityfilterreturnsOKresponse1648270965\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jsg-b2o-gjt\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1648314166\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1648314166\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"hx1-hvs-cvn\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Create_a_security_filter_returns_OK_response_1648501364\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:ExampleCreateasecurityfilterreturnsOKresponse1648501364\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ny3-xpo-xmo\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1648501364\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1648501364\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"thz-5gg-uij\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1648587764\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1648587764\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"z2t-lzm-ikl\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Create_a_security_filter_returns_OK_response_1648818166\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:ExampleCreateasecurityfilterreturnsOKresponse1648818166\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"xxn-g59-lwd\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1648832565\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1648832565\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ams-vtn-blj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1648990964\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1648990964\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"dep-t7r-bxj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1649120564\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1649120564\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"pqx-t4m-uid\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1649192564\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1649192564\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"nb6-hbx-f1q\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1649667764\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1649667764\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"gpj-cgz-shu\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Delete_a_security_filter_returns_No_Content_response-1649928918\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestDeleteasecurityfilterreturnsNoContentresponse1649928918\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"r2o-m8q-oie\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1650243764\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1650243764\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"5by-7j6-f6z\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1650358964\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1650358964\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"kkq-iwi-stm\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1650531764\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1650531764\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"no8-2ni-jmk\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1651410164\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1651410164\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"6iq-gtb-clv\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1651597364\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1651597364\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"aen-nqt-iaf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1651654964\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1651654964\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"cy4-f9z-9r6\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Delete_a_security_filter_returns_No_Content_response-1651867320\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651867320\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tka-1gc-qxq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Delete_a_security_filter_returns_No_Content_response-1651912576\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651912576\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"0su-elt-ys2\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Delete_a_security_filter_returns_No_Content_response-1651915972\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651915972\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"dj7-dy3-th8\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Delete_a_security_filter_returns_No_Content_response-1651943585\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651943585\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wku-vcl-7u1\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Create_a_security_filter_returns_OK_response-1651997988\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:TestTypescriptCreateasecurityfilterreturnsOKresponse1651997988\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"m6u-vxw-81l\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Delete_a_security_filter_returns_No_Content_response-1651997988\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1651997988\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"c1j-dxb-dtd\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Get_a_security_filter_returns_OK_response-1651997989\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptGetasecurityfilterreturnsOKresponse1651997989\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"tqh-1l5-dcq\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Update_a_security_filter_returns_OK_response-1651997990\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestTypescriptUpdateasecurityfilterreturnsOKresponse1651997990\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"1am-wfl-xby\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Typescript-Delete_a_security_filter_returns_No_Content_response-1652008989\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestTypescriptDeleteasecurityfilterreturnsNoContentresponse1652008989\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"7yz-qxi-5ja\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1656001148\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1656001148\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"opx-ymm-fi6\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1656001148\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1656001148\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"s25-hfg-20t\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Create_a_security_filter_returns_OK_response_1656001150\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:ExampleCreateasecurityfilterreturnsOKresponse1656001150\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"pgs-w1q-zf7\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1657253948\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1657253948\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"wja-o4k-gal\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1657469948\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1657469948\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"3wu-ndq-gpz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1657599548\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1657599548\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"j2f-boq-0wj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1657887548\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1657887548\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"2ur-p7o-nrz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1658175548\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1658175548\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"axt-ohp-g0w\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"tf-TestAccDatadogSecurityMonitoringFilter-local-1658516166\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"does not really match much\",\"name\":\"first\"},{\"query\":\"neither does it\",\"name\":\"second\"}],\"version\":1,\"query\":\"first query\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"vld-ebm-edf\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1658636349\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1658636349\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"jtg-flq-isg\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Update_a_security_filter_returns_OK_response_1658909949\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:ExampleUpdateasecurityfilterreturnsOKresponse1658909949\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"ris-e5s-nkj\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Create_a_security_filter_returns_OK_response_1659140350\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude staging\"}],\"version\":1,\"query\":\"service:ExampleCreateasecurityfilterreturnsOKresponse1659140350\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"r6l-kum-ywz\"},{\"attributes\":{\"is_enabled\":true,\"name\":\"Example-Get_a_security_filter_returns_OK_response_1660119548\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:ExampleGetasecurityfilterreturnsOKresponse1660119548\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"hsr-zqx-uwu\"}]}\n" }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json;charset=utf-8" + "value": "application/json" } ], - "headersSize": 565, + "headersSize": 631, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-01-06T00:52:13.160Z", - "time": 257 + "startedDateTime": "2022-09-27T13:07:00.305Z", + "time": 614 } ], "pages": [], diff --git a/cassettes/v2/Security-Monitoring_1187227211/Update-a-security-filter-returns-OK-response_945533541/frozen.json b/cassettes/v2/Security-Monitoring_1187227211/Update-a-security-filter-returns-OK-response_945533541/frozen.json index b090a6a66245..addf48629acf 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Update-a-security-filter-returns-OK-response_945533541/frozen.json +++ b/cassettes/v2/Security-Monitoring_1187227211/Update-a-security-filter-returns-OK-response_945533541/frozen.json @@ -1 +1 @@ -"2022-05-12T09:53:17.097Z" +"2022-09-27T13:07:00.937Z" diff --git a/cassettes/v2/Security-Monitoring_1187227211/Update-a-security-filter-returns-OK-response_945533541/recording.har b/cassettes/v2/Security-Monitoring_1187227211/Update-a-security-filter-returns-OK-response_945533541/recording.har index 4d1bf432598b..8fb0c7685d52 100644 --- a/cassettes/v2/Security-Monitoring_1187227211/Update-a-security-filter-returns-OK-response_945533541/recording.har +++ b/cassettes/v2/Security-Monitoring_1187227211/Update-a-security-filter-returns-OK-response_945533541/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "e3be91d1a50c2e902f0babc920f9eedc", + "_id": "c02dd3814f5e1f6e88a48aaaaae4a010", "_order": 0, "cache": {}, "request": { @@ -32,36 +32,36 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"data\":{\"attributes\":{\"exclusion_filters\":[{\"name\":\"Exclude logs from staging\",\"query\":\"source:staging\"}],\"filtered_data_type\":\"logs\",\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1652349197\",\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1652349197\"},\"type\":\"security_filters\"}}" + "text": "{\"data\":{\"attributes\":{\"exclusion_filters\":[{\"name\":\"Exclude logs from staging\",\"query\":\"source:staging\"}],\"filtered_data_type\":\"logs\",\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1664284020\",\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1664284020\"},\"type\":\"security_filters\"}}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters" }, "response": { - "bodySize": 372, + "bodySize": 373, "content": { - "mimeType": "application/json;charset=utf-8", - "size": 372, - "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1652349197\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1652349197\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"f8d-36h-d0y\"}}" + "mimeType": "application/json", + "size": 373, + "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1664284020\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[{\"query\":\"source:staging\",\"name\":\"Exclude logs from staging\"}],\"version\":1,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1664284020\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bdb-ssn-uzt\"}}\n" }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json;charset=utf-8" + "value": "application/json" } ], - "headersSize": 713, + "headersSize": 627, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:53:17.099Z", - "time": 510 + "startedDateTime": "2022-09-27T13:07:00.939Z", + "time": 454 }, { - "_id": "e4e145b59600b39e1d46be1a7766d21e", + "_id": "ec009cc8870599f724acf9817b72d611", "_order": 0, "cache": {}, "request": { @@ -85,36 +85,36 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"data\":{\"attributes\":{\"exclusion_filters\":[],\"filtered_data_type\":\"logs\",\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1652349197\",\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1652349197\",\"version\":1},\"type\":\"security_filters\"}}" + "text": "{\"data\":{\"attributes\":{\"exclusion_filters\":[],\"filtered_data_type\":\"logs\",\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1664284020\",\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1664284020\",\"version\":1},\"type\":\"security_filters\"}}" }, "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/f8d-36h-d0y" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/bdb-ssn-uzt" }, "response": { - "bodySize": 311, + "bodySize": 312, "content": { - "mimeType": "application/json;charset=utf-8", - "size": 311, - "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1652349197\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1652349197\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"f8d-36h-d0y\"}}" + "mimeType": "application/json", + "size": 312, + "text": "{\"data\":{\"attributes\":{\"is_enabled\":true,\"name\":\"Test-Update_a_security_filter_returns_OK_response-1664284020\",\"filtered_data_type\":\"logs\",\"exclusion_filters\":[],\"version\":2,\"query\":\"service:TestUpdateasecurityfilterreturnsOKresponse1664284020\",\"is_builtin\":false},\"type\":\"security_filters\",\"id\":\"bdb-ssn-uzt\"}}\n" }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json;charset=utf-8" + "value": "application/json" } ], - "headersSize": 713, + "headersSize": 627, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-12T09:53:17.614Z", - "time": 496 + "startedDateTime": "2022-09-27T13:07:01.399Z", + "time": 364 }, { - "_id": "1ebda657a403c80c8f926b2e1f568a7e", + "_id": "5fec25e0e350c101b36c40303ae75c7b", "_order": 0, "cache": {}, "request": { @@ -131,29 +131,29 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/f8d-36h-d0y" + "url": "https://api.datadoghq.com/api/v2/security_monitoring/configuration/security_filters/bdb-ssn-uzt" }, "response": { "bodySize": 0, "content": { - "mimeType": "application/json;charset=utf-8", + "mimeType": "text/html; charset=utf-8", "size": 0 }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json;charset=utf-8" + "value": "text/html; charset=utf-8" } ], - "headersSize": 692, + "headersSize": 614, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 204, "statusText": "No Content" }, - "startedDateTime": "2022-05-12T09:53:18.114Z", - "time": 462 + "startedDateTime": "2022-09-27T13:07:01.771Z", + "time": 378 } ], "pages": [], diff --git a/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.ts b/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.ts index 54ef4e146c50..5454ebaf8cbc 100644 --- a/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.ts +++ b/examples/v2/security-monitoring/UpdateSecurityMonitoringRule.ts @@ -44,6 +44,7 @@ const params: v2.SecurityMonitoringApiUpdateSecurityMonitoringRuleRequest = { distinctFields: [], groupByFields: [], metrics: [], + query: "a > 3", }, ], tags: [], diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index e25f9376cf62..ebcf2dbfd8b6 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -321,7 +321,7 @@ Feature: Security Monitoring Scenario: Update an existing rule returns "Bad Request" response Given new "UpdateSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" - And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": [], "metrics": []}], "tags": [], "version": 1} + And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": [], "metrics": [], "query": "a > 3"}], "tags": [], "version": 1} When the request is sent Then the response status is 400 Bad Request @@ -329,7 +329,7 @@ Feature: Security Monitoring Scenario: Update an existing rule returns "Not Found" response Given new "UpdateSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" - And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": [], "metrics": []}], "tags": [], "version": 1} + And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": [], "metrics": [], "query": "a > 3"}], "tags": [], "version": 1} When the request is sent Then the response status is 404 Not Found @@ -337,6 +337,6 @@ Feature: Security Monitoring Scenario: Update an existing rule returns "OK" response Given new "UpdateSecurityMonitoringRule" request And request contains "rule_id" parameter from "REPLACE.ME" - And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": [], "metrics": []}], "tags": [], "version": 1} + And body with value {"cases": [{"notifications": [], "status": "critical"}], "filters": [{"action": "require"}], "hasExtendedTitle": true, "options": {"decreaseCriticalityBasedOnEnv": false, "detectionMethod": "threshold", "evaluationWindow": 0, "hardcodedEvaluatorType": "log4shell", "impossibleTravelOptions": {"baselineUserLocations": true}, "keepAlive": 0, "maxSignalDuration": 0, "newValueOptions": {"forgetAfter": 1, "learningDuration": 0, "learningMethod": "duration", "learningThreshold": 0}}, "queries": [{"aggregation": "count", "distinctFields": [], "groupByFields": [], "metrics": [], "query": "a > 3"}], "tags": [], "version": 1} When the request is sent Then the response status is 200 OK diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index b2896543857a..50d74bbe0e91 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -701,8 +701,8 @@ export { SecurityMonitoringSignalListRequestFilter } from "./models/SecurityMoni export { SecurityMonitoringSignalListRequestPage } from "./models/SecurityMonitoringSignalListRequestPage"; export { SecurityMonitoringSignalRuleCreatePayload } from "./models/SecurityMonitoringSignalRuleCreatePayload"; export { SecurityMonitoringSignalRuleQuery } from "./models/SecurityMonitoringSignalRuleQuery"; -export { SecurityMonitoringSignalRuleQueryCreate } from "./models/SecurityMonitoringSignalRuleQueryCreate"; -export { SecurityMonitoringSignalRuleTypeCreate } from "./models/SecurityMonitoringSignalRuleTypeCreate"; +export { SecurityMonitoringSignalRuleResponse } from "./models/SecurityMonitoringSignalRuleResponse"; +export { SecurityMonitoringSignalRuleType } from "./models/SecurityMonitoringSignalRuleType"; export { SecurityMonitoringSignalsListResponse } from "./models/SecurityMonitoringSignalsListResponse"; export { SecurityMonitoringSignalsListResponseLinks } from "./models/SecurityMonitoringSignalsListResponseLinks"; export { SecurityMonitoringSignalsListResponseMeta } from "./models/SecurityMonitoringSignalsListResponseMeta"; @@ -718,7 +718,7 @@ export { SecurityMonitoringSignalTriageUpdateResponse } from "./models/SecurityM export { SecurityMonitoringSignalType } from "./models/SecurityMonitoringSignalType"; export { SecurityMonitoringStandardRuleCreatePayload } from "./models/SecurityMonitoringStandardRuleCreatePayload"; export { SecurityMonitoringStandardRuleQuery } from "./models/SecurityMonitoringStandardRuleQuery"; -export { SecurityMonitoringStandardRuleQueryCreate } from "./models/SecurityMonitoringStandardRuleQueryCreate"; +export { SecurityMonitoringStandardRuleResponse } from "./models/SecurityMonitoringStandardRuleResponse"; export { SecurityMonitoringTriageUser } from "./models/SecurityMonitoringTriageUser"; export { ServiceAccountCreateAttributes } from "./models/ServiceAccountCreateAttributes"; export { ServiceAccountCreateData } from "./models/ServiceAccountCreateData"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index e673ec5c3951..8022bee5a37b 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -351,7 +351,6 @@ import { SecurityMonitoringRuleCaseCreate } from "./SecurityMonitoringRuleCaseCr import { SecurityMonitoringRuleImpossibleTravelOptions } from "./SecurityMonitoringRuleImpossibleTravelOptions"; import { SecurityMonitoringRuleNewValueOptions } from "./SecurityMonitoringRuleNewValueOptions"; import { SecurityMonitoringRuleOptions } from "./SecurityMonitoringRuleOptions"; -import { SecurityMonitoringRuleResponse } from "./SecurityMonitoringRuleResponse"; import { SecurityMonitoringRuleUpdatePayload } from "./SecurityMonitoringRuleUpdatePayload"; import { SecurityMonitoringSignal } from "./SecurityMonitoringSignal"; import { SecurityMonitoringSignalAssigneeUpdateAttributes } from "./SecurityMonitoringSignalAssigneeUpdateAttributes"; @@ -366,7 +365,7 @@ import { SecurityMonitoringSignalListRequestFilter } from "./SecurityMonitoringS import { SecurityMonitoringSignalListRequestPage } from "./SecurityMonitoringSignalListRequestPage"; import { SecurityMonitoringSignalRuleCreatePayload } from "./SecurityMonitoringSignalRuleCreatePayload"; import { SecurityMonitoringSignalRuleQuery } from "./SecurityMonitoringSignalRuleQuery"; -import { SecurityMonitoringSignalRuleQueryCreate } from "./SecurityMonitoringSignalRuleQueryCreate"; +import { SecurityMonitoringSignalRuleResponse } from "./SecurityMonitoringSignalRuleResponse"; import { SecurityMonitoringSignalStateUpdateAttributes } from "./SecurityMonitoringSignalStateUpdateAttributes"; import { SecurityMonitoringSignalStateUpdateData } from "./SecurityMonitoringSignalStateUpdateData"; import { SecurityMonitoringSignalStateUpdateRequest } from "./SecurityMonitoringSignalStateUpdateRequest"; @@ -379,7 +378,7 @@ import { SecurityMonitoringSignalsListResponseMeta } from "./SecurityMonitoringS import { SecurityMonitoringSignalsListResponseMetaPage } from "./SecurityMonitoringSignalsListResponseMetaPage"; import { SecurityMonitoringStandardRuleCreatePayload } from "./SecurityMonitoringStandardRuleCreatePayload"; import { SecurityMonitoringStandardRuleQuery } from "./SecurityMonitoringStandardRuleQuery"; -import { SecurityMonitoringStandardRuleQueryCreate } from "./SecurityMonitoringStandardRuleQueryCreate"; +import { SecurityMonitoringStandardRuleResponse } from "./SecurityMonitoringStandardRuleResponse"; import { SecurityMonitoringTriageUser } from "./SecurityMonitoringTriageUser"; import { ServiceAccountCreateAttributes } from "./ServiceAccountCreateAttributes"; import { ServiceAccountCreateData } from "./ServiceAccountCreateData"; @@ -633,7 +632,6 @@ const enumsMap: { [key: string]: any[] } = { SecurityMonitoringRuleTypeCreate: ["log_detection", "workload_security"], SecurityMonitoringRuleTypeRead: [ "log_detection", - "signal_correlation", "infrastructure_configuration", "workload_security", "cloud_configuration", @@ -644,7 +642,7 @@ const enumsMap: { [key: string]: any[] } = { "testing_or_maintenance", "other", ], - SecurityMonitoringSignalRuleTypeCreate: ["signal_correlation"], + SecurityMonitoringSignalRuleType: ["signal_correlation"], SecurityMonitoringSignalState: ["open", "archived", "under_review"], SecurityMonitoringSignalType: ["signal"], SecurityMonitoringSignalsSort: ["timestamp", "-timestamp"], @@ -1030,7 +1028,6 @@ const typeMap: { [index: string]: any } = { SecurityMonitoringRuleImpossibleTravelOptions, SecurityMonitoringRuleNewValueOptions: SecurityMonitoringRuleNewValueOptions, SecurityMonitoringRuleOptions: SecurityMonitoringRuleOptions, - SecurityMonitoringRuleResponse: SecurityMonitoringRuleResponse, SecurityMonitoringRuleUpdatePayload: SecurityMonitoringRuleUpdatePayload, SecurityMonitoringSignal: SecurityMonitoringSignal, SecurityMonitoringSignalAssigneeUpdateAttributes: @@ -1054,8 +1051,7 @@ const typeMap: { [index: string]: any } = { SecurityMonitoringSignalRuleCreatePayload: SecurityMonitoringSignalRuleCreatePayload, SecurityMonitoringSignalRuleQuery: SecurityMonitoringSignalRuleQuery, - SecurityMonitoringSignalRuleQueryCreate: - SecurityMonitoringSignalRuleQueryCreate, + SecurityMonitoringSignalRuleResponse: SecurityMonitoringSignalRuleResponse, SecurityMonitoringSignalStateUpdateAttributes: SecurityMonitoringSignalStateUpdateAttributes, SecurityMonitoringSignalStateUpdateData: @@ -1078,8 +1074,8 @@ const typeMap: { [index: string]: any } = { SecurityMonitoringStandardRuleCreatePayload: SecurityMonitoringStandardRuleCreatePayload, SecurityMonitoringStandardRuleQuery: SecurityMonitoringStandardRuleQuery, - SecurityMonitoringStandardRuleQueryCreate: - SecurityMonitoringStandardRuleQueryCreate, + SecurityMonitoringStandardRuleResponse: + SecurityMonitoringStandardRuleResponse, SecurityMonitoringTriageUser: SecurityMonitoringTriageUser, ServiceAccountCreateAttributes: ServiceAccountCreateAttributes, ServiceAccountCreateData: ServiceAccountCreateData, @@ -1160,6 +1156,10 @@ const oneOfMap: { [index: string]: string[] } = { "SecurityMonitoringStandardRuleQuery", "SecurityMonitoringSignalRuleQuery", ], + SecurityMonitoringRuleResponse: [ + "SecurityMonitoringStandardRuleResponse", + "SecurityMonitoringSignalRuleResponse", + ], UserResponseIncludedItem: ["Organization", "Permission", "Role"], }; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleResponse.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleResponse.ts index 873850e54516..6350fa1e06b9 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleResponse.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleResponse.ts @@ -3,176 +3,16 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { SecurityMonitoringFilter } from "./SecurityMonitoringFilter"; -import { SecurityMonitoringRuleCase } from "./SecurityMonitoringRuleCase"; -import { SecurityMonitoringRuleOptions } from "./SecurityMonitoringRuleOptions"; -import { SecurityMonitoringRuleQuery } from "./SecurityMonitoringRuleQuery"; -import { SecurityMonitoringRuleTypeRead } from "./SecurityMonitoringRuleTypeRead"; +import { SecurityMonitoringSignalRuleResponse } from "./SecurityMonitoringSignalRuleResponse"; +import { SecurityMonitoringStandardRuleResponse } from "./SecurityMonitoringStandardRuleResponse"; -import { AttributeTypeMap } from "../../datadog-api-client-common/util"; +import { UnparsedObject } from "../../datadog-api-client-common/util"; /** - * Rule. + * Create a new rule. */ -export class SecurityMonitoringRuleResponse { - /** - * Cases for generating signals. - */ - "cases"?: Array; - /** - * When the rule was created, timestamp in milliseconds. - */ - "createdAt"?: number; - /** - * User ID of the user who created the rule. - */ - "creationAuthorId"?: number; - /** - * Additional queries to filter matched events before they are processed. - */ - "filters"?: Array; - /** - * Whether the notifications include the triggering group-by values in their title. - */ - "hasExtendedTitle"?: boolean; - /** - * The ID of the rule. - */ - "id"?: string; - /** - * Whether the rule is included by default. - */ - "isDefault"?: boolean; - /** - * Whether the rule has been deleted. - */ - "isDeleted"?: boolean; - /** - * Whether the rule is enabled. - */ - "isEnabled"?: boolean; - /** - * Message for generated signals. - */ - "message"?: string; - /** - * The name of the rule. - */ - "name"?: string; - /** - * Options on rules. - */ - "options"?: SecurityMonitoringRuleOptions; - /** - * Queries for selecting logs which are part of the rule. - */ - "queries"?: Array; - /** - * Tags for generated signals. - */ - "tags"?: Array; - /** - * The rule type. - */ - "type"?: SecurityMonitoringRuleTypeRead; - /** - * User ID of the user who updated the rule. - */ - "updateAuthorId"?: number; - /** - * The version of the rule. - */ - "version"?: number; - /** - * @ignore - */ - "unparsedObject"?: any; - - /** - * @ignore - */ - static readonly attributeTypeMap: AttributeTypeMap = { - cases: { - baseName: "cases", - type: "Array", - }, - createdAt: { - baseName: "createdAt", - type: "number", - format: "int64", - }, - creationAuthorId: { - baseName: "creationAuthorId", - type: "number", - format: "int64", - }, - filters: { - baseName: "filters", - type: "Array", - }, - hasExtendedTitle: { - baseName: "hasExtendedTitle", - type: "boolean", - }, - id: { - baseName: "id", - type: "string", - }, - isDefault: { - baseName: "isDefault", - type: "boolean", - }, - isDeleted: { - baseName: "isDeleted", - type: "boolean", - }, - isEnabled: { - baseName: "isEnabled", - type: "boolean", - }, - message: { - baseName: "message", - type: "string", - }, - name: { - baseName: "name", - type: "string", - }, - options: { - baseName: "options", - type: "SecurityMonitoringRuleOptions", - }, - queries: { - baseName: "queries", - type: "Array", - }, - tags: { - baseName: "tags", - type: "Array", - }, - type: { - baseName: "type", - type: "SecurityMonitoringRuleTypeRead", - }, - updateAuthorId: { - baseName: "updateAuthorId", - type: "number", - format: "int64", - }, - version: { - baseName: "version", - type: "number", - format: "int64", - }, - }; - - /** - * @ignore - */ - static getAttributeTypeMap(): AttributeTypeMap { - return SecurityMonitoringRuleResponse.attributeTypeMap; - } - - public constructor() {} -} +export type SecurityMonitoringRuleResponse = + | SecurityMonitoringStandardRuleResponse + | SecurityMonitoringSignalRuleResponse + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleTypeRead.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleTypeRead.ts index b701cc714cba..dc28854bae83 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringRuleTypeRead.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringRuleTypeRead.ts @@ -6,12 +6,10 @@ export type SecurityMonitoringRuleTypeRead = | typeof LOG_DETECTION - | typeof SIGNAL_CORRELATION | typeof INFRASTRUCTURE_CONFIGURATION | typeof WORKLOAD_SECURITY | typeof CLOUD_CONFIGURATION; export const LOG_DETECTION = "log_detection"; -export const SIGNAL_CORRELATION = "signal_correlation"; export const INFRASTRUCTURE_CONFIGURATION = "infrastructure_configuration"; export const WORKLOAD_SECURITY = "workload_security"; export const CLOUD_CONFIGURATION = "cloud_configuration"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleCreatePayload.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleCreatePayload.ts index 157ddc7cb81c..151f3722cf55 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleCreatePayload.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleCreatePayload.ts @@ -6,8 +6,8 @@ import { SecurityMonitoringFilter } from "./SecurityMonitoringFilter"; import { SecurityMonitoringRuleCaseCreate } from "./SecurityMonitoringRuleCaseCreate"; import { SecurityMonitoringRuleOptions } from "./SecurityMonitoringRuleOptions"; -import { SecurityMonitoringSignalRuleQueryCreate } from "./SecurityMonitoringSignalRuleQueryCreate"; -import { SecurityMonitoringSignalRuleTypeCreate } from "./SecurityMonitoringSignalRuleTypeCreate"; +import { SecurityMonitoringSignalRuleQuery } from "./SecurityMonitoringSignalRuleQuery"; +import { SecurityMonitoringSignalRuleType } from "./SecurityMonitoringSignalRuleType"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -46,7 +46,7 @@ export class SecurityMonitoringSignalRuleCreatePayload { /** * Queries for selecting signals which are part of the rule. */ - "queries": Array; + "queries": Array; /** * Tags for generated signals. */ @@ -54,7 +54,7 @@ export class SecurityMonitoringSignalRuleCreatePayload { /** * The rule type. */ - "type"?: SecurityMonitoringSignalRuleTypeCreate; + "type"?: SecurityMonitoringSignalRuleType; /** * @ignore @@ -100,7 +100,7 @@ export class SecurityMonitoringSignalRuleCreatePayload { }, queries: { baseName: "queries", - type: "Array", + type: "Array", required: true, }, tags: { @@ -109,7 +109,7 @@ export class SecurityMonitoringSignalRuleCreatePayload { }, type: { baseName: "type", - type: "SecurityMonitoringSignalRuleTypeCreate", + type: "SecurityMonitoringSignalRuleType", }, }; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQuery.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQuery.ts index 2683c8437ab1..a638d002c017 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQuery.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQuery.ts @@ -34,7 +34,7 @@ export class SecurityMonitoringSignalRuleQuery { /** * Rule ID to match on signals. */ - "ruleId"?: string; + "ruleId": string; /** * @ignore @@ -69,6 +69,7 @@ export class SecurityMonitoringSignalRuleQuery { ruleId: { baseName: "ruleId", type: "string", + required: true, }, }; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQueryCreate.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQueryCreate.ts deleted file mode 100644 index 08ea1c5082e3..000000000000 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleQueryCreate.ts +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2020-Present Datadog, Inc. - */ -import { SecurityMonitoringRuleQueryAggregation } from "./SecurityMonitoringRuleQueryAggregation"; - -import { AttributeTypeMap } from "../../datadog-api-client-common/util"; - -/** - * Query for matching rule on signals - */ -export class SecurityMonitoringSignalRuleQueryCreate { - /** - * The aggregation type. - */ - "aggregation"?: SecurityMonitoringRuleQueryAggregation; - /** - * Fields to group by. - */ - "correlatedByFields"?: Array; - /** - * Index of the rule query used to retrieve the correlated field. - */ - "correlatedQueryIndex"?: number; - /** - * Group of target fields to aggregate over when using the new value aggregations. - */ - "metrics"?: Array; - /** - * Name of the query. - */ - "name"?: string; - /** - * Rule ID to match on signals. - */ - "ruleId": string; - - /** - * @ignore - */ - "unparsedObject"?: any; - - /** - * @ignore - */ - static readonly attributeTypeMap: AttributeTypeMap = { - aggregation: { - baseName: "aggregation", - type: "SecurityMonitoringRuleQueryAggregation", - }, - correlatedByFields: { - baseName: "correlatedByFields", - type: "Array", - }, - correlatedQueryIndex: { - baseName: "correlatedQueryIndex", - type: "number", - format: "int32", - }, - metrics: { - baseName: "metrics", - type: "Array", - }, - name: { - baseName: "name", - type: "string", - }, - ruleId: { - baseName: "ruleId", - type: "string", - required: true, - }, - }; - - /** - * @ignore - */ - static getAttributeTypeMap(): AttributeTypeMap { - return SecurityMonitoringSignalRuleQueryCreate.attributeTypeMap; - } - - public constructor() {} -} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleResponse.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleResponse.ts new file mode 100644 index 000000000000..2a1f97c1fa54 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleResponse.ts @@ -0,0 +1,178 @@ +/** + * 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. + */ +import { SecurityMonitoringFilter } from "./SecurityMonitoringFilter"; +import { SecurityMonitoringRuleCase } from "./SecurityMonitoringRuleCase"; +import { SecurityMonitoringRuleOptions } from "./SecurityMonitoringRuleOptions"; +import { SecurityMonitoringSignalRuleQuery } from "./SecurityMonitoringSignalRuleQuery"; +import { SecurityMonitoringSignalRuleType } from "./SecurityMonitoringSignalRuleType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Rule. + */ +export class SecurityMonitoringSignalRuleResponse { + /** + * Cases for generating signals. + */ + "cases"?: Array; + /** + * When the rule was created, timestamp in milliseconds. + */ + "createdAt"?: number; + /** + * User ID of the user who created the rule. + */ + "creationAuthorId"?: number; + /** + * Additional queries to filter matched events before they are processed. + */ + "filters"?: Array; + /** + * Whether the notifications include the triggering group-by values in their title. + */ + "hasExtendedTitle"?: boolean; + /** + * The ID of the rule. + */ + "id"?: string; + /** + * Whether the rule is included by default. + */ + "isDefault"?: boolean; + /** + * Whether the rule has been deleted. + */ + "isDeleted"?: boolean; + /** + * Whether the rule is enabled. + */ + "isEnabled"?: boolean; + /** + * Message for generated signals. + */ + "message"?: string; + /** + * The name of the rule. + */ + "name"?: string; + /** + * Options on rules. + */ + "options"?: SecurityMonitoringRuleOptions; + /** + * Queries for selecting logs which are part of the rule. + */ + "queries"?: Array; + /** + * Tags for generated signals. + */ + "tags"?: Array; + /** + * The rule type. + */ + "type"?: SecurityMonitoringSignalRuleType; + /** + * User ID of the user who updated the rule. + */ + "updateAuthorId"?: number; + /** + * The version of the rule. + */ + "version"?: number; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + cases: { + baseName: "cases", + type: "Array", + }, + createdAt: { + baseName: "createdAt", + type: "number", + format: "int64", + }, + creationAuthorId: { + baseName: "creationAuthorId", + type: "number", + format: "int64", + }, + filters: { + baseName: "filters", + type: "Array", + }, + hasExtendedTitle: { + baseName: "hasExtendedTitle", + type: "boolean", + }, + id: { + baseName: "id", + type: "string", + }, + isDefault: { + baseName: "isDefault", + type: "boolean", + }, + isDeleted: { + baseName: "isDeleted", + type: "boolean", + }, + isEnabled: { + baseName: "isEnabled", + type: "boolean", + }, + message: { + baseName: "message", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + options: { + baseName: "options", + type: "SecurityMonitoringRuleOptions", + }, + queries: { + baseName: "queries", + type: "Array", + }, + tags: { + baseName: "tags", + type: "Array", + }, + type: { + baseName: "type", + type: "SecurityMonitoringSignalRuleType", + }, + updateAuthorId: { + baseName: "updateAuthorId", + type: "number", + format: "int64", + }, + version: { + baseName: "version", + type: "number", + format: "int64", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringSignalRuleResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleTypeCreate.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleType.ts similarity index 78% rename from packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleTypeCreate.ts rename to packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleType.ts index 862a14c6f8e4..804e0e54cf55 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleTypeCreate.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringSignalRuleType.ts @@ -4,5 +4,5 @@ * Copyright 2020-Present Datadog, Inc. */ -export type SecurityMonitoringSignalRuleTypeCreate = typeof SIGNAL_CORRELATION; +export type SecurityMonitoringSignalRuleType = typeof SIGNAL_CORRELATION; export const SIGNAL_CORRELATION = "signal_correlation"; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleCreatePayload.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleCreatePayload.ts index 45f5d55ca52e..276b6e8bdd0f 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleCreatePayload.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleCreatePayload.ts @@ -7,7 +7,7 @@ import { SecurityMonitoringFilter } from "./SecurityMonitoringFilter"; import { SecurityMonitoringRuleCaseCreate } from "./SecurityMonitoringRuleCaseCreate"; import { SecurityMonitoringRuleOptions } from "./SecurityMonitoringRuleOptions"; import { SecurityMonitoringRuleTypeCreate } from "./SecurityMonitoringRuleTypeCreate"; -import { SecurityMonitoringStandardRuleQueryCreate } from "./SecurityMonitoringStandardRuleQueryCreate"; +import { SecurityMonitoringStandardRuleQuery } from "./SecurityMonitoringStandardRuleQuery"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -46,7 +46,7 @@ export class SecurityMonitoringStandardRuleCreatePayload { /** * Queries for selecting logs which are part of the rule. */ - "queries": Array; + "queries": Array; /** * Tags for generated signals. */ @@ -100,7 +100,7 @@ export class SecurityMonitoringStandardRuleCreatePayload { }, queries: { baseName: "queries", - type: "Array", + type: "Array", required: true, }, tags: { diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQuery.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQuery.ts index 882f6972d241..1cee34701f69 100644 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQuery.ts +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQuery.ts @@ -39,7 +39,7 @@ export class SecurityMonitoringStandardRuleQuery { /** * Query to run on logs. */ - "query"?: string; + "query": string; /** * @ignore @@ -77,6 +77,7 @@ export class SecurityMonitoringStandardRuleQuery { query: { baseName: "query", type: "string", + required: true, }, }; diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQueryCreate.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQueryCreate.ts deleted file mode 100644 index 2bc10eba247b..000000000000 --- a/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleQueryCreate.ts +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2020-Present Datadog, Inc. - */ -import { SecurityMonitoringRuleQueryAggregation } from "./SecurityMonitoringRuleQueryAggregation"; - -import { AttributeTypeMap } from "../../datadog-api-client-common/util"; - -/** - * Query for matching rule. - */ -export class SecurityMonitoringStandardRuleQueryCreate { - /** - * The aggregation type. - */ - "aggregation"?: SecurityMonitoringRuleQueryAggregation; - /** - * Field for which the cardinality is measured. Sent as an array. - */ - "distinctFields"?: Array; - /** - * Fields to group by. - */ - "groupByFields"?: Array; - /** - * The target field to aggregate over when using the sum or max - * aggregations. - */ - "metric"?: string; - /** - * Group of target fields to aggregate over when using the new value aggregations. - */ - "metrics"?: Array; - /** - * Name of the query. - */ - "name"?: string; - /** - * Query to run on logs. - */ - "query": string; - - /** - * @ignore - */ - "unparsedObject"?: any; - - /** - * @ignore - */ - static readonly attributeTypeMap: AttributeTypeMap = { - aggregation: { - baseName: "aggregation", - type: "SecurityMonitoringRuleQueryAggregation", - }, - distinctFields: { - baseName: "distinctFields", - type: "Array", - }, - groupByFields: { - baseName: "groupByFields", - type: "Array", - }, - metric: { - baseName: "metric", - type: "string", - }, - metrics: { - baseName: "metrics", - type: "Array", - }, - name: { - baseName: "name", - type: "string", - }, - query: { - baseName: "query", - type: "string", - required: true, - }, - }; - - /** - * @ignore - */ - static getAttributeTypeMap(): AttributeTypeMap { - return SecurityMonitoringStandardRuleQueryCreate.attributeTypeMap; - } - - public constructor() {} -} diff --git a/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleResponse.ts b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleResponse.ts new file mode 100644 index 000000000000..533aa3e31f90 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SecurityMonitoringStandardRuleResponse.ts @@ -0,0 +1,178 @@ +/** + * 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. + */ +import { SecurityMonitoringFilter } from "./SecurityMonitoringFilter"; +import { SecurityMonitoringRuleCase } from "./SecurityMonitoringRuleCase"; +import { SecurityMonitoringRuleOptions } from "./SecurityMonitoringRuleOptions"; +import { SecurityMonitoringRuleTypeRead } from "./SecurityMonitoringRuleTypeRead"; +import { SecurityMonitoringStandardRuleQuery } from "./SecurityMonitoringStandardRuleQuery"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Rule. + */ +export class SecurityMonitoringStandardRuleResponse { + /** + * Cases for generating signals. + */ + "cases"?: Array; + /** + * When the rule was created, timestamp in milliseconds. + */ + "createdAt"?: number; + /** + * User ID of the user who created the rule. + */ + "creationAuthorId"?: number; + /** + * Additional queries to filter matched events before they are processed. + */ + "filters"?: Array; + /** + * Whether the notifications include the triggering group-by values in their title. + */ + "hasExtendedTitle"?: boolean; + /** + * The ID of the rule. + */ + "id"?: string; + /** + * Whether the rule is included by default. + */ + "isDefault"?: boolean; + /** + * Whether the rule has been deleted. + */ + "isDeleted"?: boolean; + /** + * Whether the rule is enabled. + */ + "isEnabled"?: boolean; + /** + * Message for generated signals. + */ + "message"?: string; + /** + * The name of the rule. + */ + "name"?: string; + /** + * Options on rules. + */ + "options"?: SecurityMonitoringRuleOptions; + /** + * Queries for selecting logs which are part of the rule. + */ + "queries"?: Array; + /** + * Tags for generated signals. + */ + "tags"?: Array; + /** + * The rule type. + */ + "type"?: SecurityMonitoringRuleTypeRead; + /** + * User ID of the user who updated the rule. + */ + "updateAuthorId"?: number; + /** + * The version of the rule. + */ + "version"?: number; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + cases: { + baseName: "cases", + type: "Array", + }, + createdAt: { + baseName: "createdAt", + type: "number", + format: "int64", + }, + creationAuthorId: { + baseName: "creationAuthorId", + type: "number", + format: "int64", + }, + filters: { + baseName: "filters", + type: "Array", + }, + hasExtendedTitle: { + baseName: "hasExtendedTitle", + type: "boolean", + }, + id: { + baseName: "id", + type: "string", + }, + isDefault: { + baseName: "isDefault", + type: "boolean", + }, + isDeleted: { + baseName: "isDeleted", + type: "boolean", + }, + isEnabled: { + baseName: "isEnabled", + type: "boolean", + }, + message: { + baseName: "message", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + options: { + baseName: "options", + type: "SecurityMonitoringRuleOptions", + }, + queries: { + baseName: "queries", + type: "Array", + }, + tags: { + baseName: "tags", + type: "Array", + }, + type: { + baseName: "type", + type: "SecurityMonitoringRuleTypeRead", + }, + updateAuthorId: { + baseName: "updateAuthorId", + type: "number", + format: "int64", + }, + version: { + baseName: "version", + type: "number", + format: "int64", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SecurityMonitoringStandardRuleResponse.attributeTypeMap; + } + + public constructor() {} +} From 75d484d3a65dc963fc366166a661bbd6f4163f2d Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:30:25 +0000 Subject: [PATCH 25/30] Regenerate client from commit 4a552860 of spec repo (#858) Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> --- .apigentools-info | 8 ++++---- features/v2/usage_metering.feature | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index 4b92b2e5eb0e..e7c1cc48a6a6 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-28 09:08:38.326030", - "spec_repo_commit": "2bc1a788" + "regenerated": "2022-09-28 14:01:10.591063", + "spec_repo_commit": "4a552860" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-28 09:08:38.338291", - "spec_repo_commit": "2bc1a788" + "regenerated": "2022-09-28 14:01:10.605853", + "spec_repo_commit": "4a552860" } } } \ No newline at end of file diff --git a/features/v2/usage_metering.feature b/features/v2/usage_metering.feature index 3edf8d79524a..11ec67a035fc 100644 --- a/features/v2/usage_metering.feature +++ b/features/v2/usage_metering.feature @@ -47,7 +47,7 @@ Feature: Usage Metering When the request is sent Then the response status is 400 Bad Request - @team:DataDog/red-zone-revenue-query + @replay-only @team:DataDog/red-zone-revenue-query Scenario: Get historical cost across your account returns "OK" response Given new "GetHistoricalCostByOrg" request And request contains "start_month" parameter with value "{{ timeISO('now - 1m') }}" From 0a88f643f88039940926ebb42cfbee61a2b7535b Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 06:45:10 +0000 Subject: [PATCH 26/30] Regenerate client from commit 5c013ee5 of spec repo (#859) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- .../frozen.json | 2 +- .../recording.har | 73 +++++++++---------- .../CreateGlobalVariable_1068962881.ts | 2 +- features/v1/synthetics.feature | 1 + .../synthetics_global_variable_payload.json | 2 +- 6 files changed, 44 insertions(+), 44 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index e7c1cc48a6a6..9532b8c2ac3e 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-28 14:01:10.591063", - "spec_repo_commit": "4a552860" + "regenerated": "2022-09-28 16:41:33.701189", + "spec_repo_commit": "5c013ee5" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-28 14:01:10.605853", - "spec_repo_commit": "4a552860" + "regenerated": "2022-09-28 16:41:33.713516", + "spec_repo_commit": "5c013ee5" } } } \ No newline at end of file diff --git a/cassettes/v1/Synthetics_2658572017/Create-a-global-variable-from-test-returns-OK-response_2967481205/frozen.json b/cassettes/v1/Synthetics_2658572017/Create-a-global-variable-from-test-returns-OK-response_2967481205/frozen.json index 7751d27f16e9..90ad3a2b5ebd 100644 --- a/cassettes/v1/Synthetics_2658572017/Create-a-global-variable-from-test-returns-OK-response_2967481205/frozen.json +++ b/cassettes/v1/Synthetics_2658572017/Create-a-global-variable-from-test-returns-OK-response_2967481205/frozen.json @@ -1 +1 @@ -"2022-08-30T12:58:48.527Z" +"2022-09-28T14:10:51.476Z" diff --git a/cassettes/v1/Synthetics_2658572017/Create-a-global-variable-from-test-returns-OK-response_2967481205/recording.har b/cassettes/v1/Synthetics_2658572017/Create-a-global-variable-from-test-returns-OK-response_2967481205/recording.har index 0bc34ed64da3..17a6453c6b19 100644 --- a/cassettes/v1/Synthetics_2658572017/Create-a-global-variable-from-test-returns-OK-response_2967481205/recording.har +++ b/cassettes/v1/Synthetics_2658572017/Create-a-global-variable-from-test-returns-OK-response_2967481205/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "3734d43e541d3f843e5ff98d556dfbcd", + "_id": "3a7b0e92d5b88888edcdc157ad4e4533", "_order": 0, "cache": {}, "request": { @@ -26,13 +26,13 @@ "value": "application/json" } ], - "headersSize": 579, + "headersSize": 577, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"config\":{\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"steps\":[{\"allowFailure\":true,\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"extractedValues\":[{\"field\":\"server\",\"name\":\"EXTRACTED_VALUE\",\"parser\":{\"type\":\"raw\"},\"type\":\"http_header\"}],\"isCritical\":true,\"name\":\"request is sent\",\"request\":{\"method\":\"GET\",\"timeout\":10,\"url\":\"https://datadoghq.com\"},\"retry\":{\"count\":5,\"interval\":1000},\"subtype\":\"http\"}]},\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_test_multi_step_payload.json\",\"name\":\"Test-Create_a_global_variable_from_test_returns_OK_response-1661864328\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Create_a_global_variable_from_test_returns_OK_response-1661864328\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":1000},\"tick_every\":60},\"subtype\":\"multi\",\"tags\":[\"testing:api\"],\"type\":\"api\"}" + "text": "{\"config\":{\"configVariables\":[{\"example\":\"content-type\",\"name\":\"PROPERTY\",\"pattern\":\"content-type\",\"type\":\"text\"}],\"steps\":[{\"allowFailure\":true,\"assertions\":[{\"operator\":\"is\",\"target\":200,\"type\":\"statusCode\"}],\"extractedValues\":[{\"field\":\"server\",\"name\":\"EXTRACTED_VALUE\",\"parser\":{\"type\":\"raw\"},\"type\":\"http_header\"}],\"isCritical\":true,\"name\":\"request is sent\",\"request\":{\"method\":\"GET\",\"timeout\":10,\"url\":\"https://datadoghq.com\"},\"retry\":{\"count\":5,\"interval\":1000},\"subtype\":\"http\"}]},\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_test_multi_step_payload.json\",\"name\":\"Test-Create_a_global_variable_from_test_returns_OK_response-1664374251\",\"options\":{\"accept_self_signed\":false,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"min_location_failed\":1,\"monitor_name\":\"Test-Create_a_global_variable_from_test_returns_OK_response-1664374251\",\"monitor_priority\":5,\"retry\":{\"count\":3,\"interval\":1000},\"tick_every\":60},\"subtype\":\"multi\",\"tags\":[\"testing:api\"],\"type\":\"api\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/synthetics/tests/api" @@ -42,7 +42,7 @@ "content": { "mimeType": "application/json", "size": 1238, - "text": "{\"status\":\"live\",\"public_id\":\"frc-8cs-fce\",\"tags\":[\"testing:api\"],\"org_id\":321813,\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_test_multi_step_payload.json\",\"deleted_at\":null,\"name\":\"Test-Create_a_global_variable_from_test_returns_OK_response-1661864328\",\"monitor_id\":81568613,\"type\":\"api\",\"created_at\":\"2022-08-30T12:58:49.246616+00:00\",\"modified_at\":\"2022-08-30T12:58:49.246616+00:00\",\"subtype\":\"multi\",\"config\":{\"steps\":[{\"retry\":{\"count\":5,\"interval\":1000},\"name\":\"request is sent\",\"request\":{\"url\":\"https://datadoghq.com\",\"method\":\"GET\",\"timeout\":10},\"subtype\":\"http\",\"allowFailure\":true,\"assertions\":[{\"operator\":\"is\",\"type\":\"statusCode\",\"target\":200}],\"isCritical\":true,\"id\":\"zty-xpv-7cw\",\"extractedValues\":[{\"field\":\"server\",\"parser\":{\"type\":\"raw\"},\"type\":\"http_header\",\"name\":\"EXTRACTED_VALUE\"}]}],\"configVariables\":[{\"pattern\":\"content-type\",\"type\":\"text\",\"example\":\"content-type\",\"name\":\"PROPERTY\"}]},\"options\":{\"accept_self_signed\":false,\"retry\":{\"count\":3,\"interval\":1000},\"min_location_failed\":1,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"monitor_priority\":5,\"monitor_name\":\"Test-Create_a_global_variable_from_test_returns_OK_response-1661864328\",\"tick_every\":60}}" + "text": "{\"status\":\"live\",\"public_id\":\"nsx-pp5-8tb\",\"tags\":[\"testing:api\"],\"org_id\":321813,\"locations\":[\"aws:us-east-2\"],\"message\":\"BDD test payload: synthetics_api_test_multi_step_payload.json\",\"deleted_at\":null,\"name\":\"Test-Create_a_global_variable_from_test_returns_OK_response-1664374251\",\"monitor_id\":92664497,\"type\":\"api\",\"created_at\":\"2022-09-28T14:10:52.140404+00:00\",\"modified_at\":\"2022-09-28T14:10:52.140404+00:00\",\"subtype\":\"multi\",\"config\":{\"steps\":[{\"retry\":{\"count\":5,\"interval\":1000},\"name\":\"request is sent\",\"request\":{\"url\":\"https://datadoghq.com\",\"method\":\"GET\",\"timeout\":10},\"subtype\":\"http\",\"allowFailure\":true,\"assertions\":[{\"operator\":\"is\",\"type\":\"statusCode\",\"target\":200}],\"isCritical\":true,\"id\":\"782-qng-yfe\",\"extractedValues\":[{\"field\":\"server\",\"parser\":{\"type\":\"raw\"},\"type\":\"http_header\",\"name\":\"EXTRACTED_VALUE\"}]}],\"configVariables\":[{\"pattern\":\"content-type\",\"type\":\"text\",\"example\":\"content-type\",\"name\":\"PROPERTY\"}]},\"options\":{\"accept_self_signed\":false,\"retry\":{\"count\":3,\"interval\":1000},\"min_location_failed\":1,\"allow_insecure\":true,\"follow_redirects\":true,\"min_failure_duration\":10,\"monitor_priority\":5,\"monitor_name\":\"Test-Create_a_global_variable_from_test_returns_OK_response-1664374251\",\"tick_every\":60}}" }, "cookies": [], "headers": [ @@ -51,21 +51,21 @@ "value": "application/json" } ], - "headersSize": 624, + "headersSize": 623, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-08-30T12:58:48.531Z", - "time": 717 + "startedDateTime": "2022-09-28T14:10:51.487Z", + "time": 775 }, { - "_id": "d812322c60d02243f4e211d58d04a368", + "_id": "cf6515ef523623e9deaae45f6888861a", "_order": 0, "cache": {}, "request": { - "bodySize": 219, + "bodySize": 280, "cookies": [], "headers": [ { @@ -79,23 +79,23 @@ "value": "application/json" } ], - "headersSize": 575, + "headersSize": 573, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"description\":\"\",\"name\":\"GLOBAL_VARIABLE_PAYLOAD\",\"parse_test_options\":{\"localVariableName\":\"EXTRACTED_VALUE\",\"type\":\"local_variable\"},\"parse_test_public_id\":\"frc-8cs-fce\",\"tags\":[],\"value\":{\"secure\":false,\"value\":\"\"}}" + "text": "{\"description\":\"\",\"name\":\"GLOBAL_VARIABLE_PAYLOAD_TESTCREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE1664374251\",\"parse_test_options\":{\"localVariableName\":\"EXTRACTED_VALUE\",\"type\":\"local_variable\"},\"parse_test_public_id\":\"nsx-pp5-8tb\",\"tags\":[],\"value\":{\"secure\":false,\"value\":\"\"}}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/synthetics/variables" }, "response": { - "bodySize": 369, + "bodySize": 430, "content": { "mimeType": "application/json", - "size": 369, - "text": "{\"parse_test_options\":{\"type\":\"local_variable\",\"localVariableName\":\"EXTRACTED_VALUE\"},\"parse_test_extracted_at\":null,\"description\":\"\",\"tags\":[],\"last_error\":null,\"is_totp\":null,\"value\":{\"secure\":false,\"value\":\"\"},\"parse_test_public_id\":\"frc-8cs-fce\",\"parse_test_name\":null,\"type\":\"variable\",\"id\":\"9dec05d1-27b9-4e16-9ec5-0305af3ac10a\",\"name\":\"GLOBAL_VARIABLE_PAYLOAD\"}\n" + "size": 430, + "text": "{\"parse_test_options\":{\"type\":\"local_variable\",\"localVariableName\":\"EXTRACTED_VALUE\"},\"parse_test_extracted_at\":null,\"description\":\"\",\"tags\":[],\"last_error\":null,\"is_totp\":null,\"value\":{\"secure\":false,\"value\":\"\"},\"parse_test_public_id\":\"nsx-pp5-8tb\",\"parse_test_name\":null,\"type\":\"variable\",\"id\":\"4507df9b-a12d-4dfe-b020-c76d4e96d286\",\"name\":\"GLOBAL_VARIABLE_PAYLOAD_TESTCREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE1664374251\"}\n" }, "cookies": [], "headers": [ @@ -104,17 +104,17 @@ "value": "application/json" } ], - "headersSize": 623, + "headersSize": 622, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-08-30T12:58:49.258Z", - "time": 592 + "startedDateTime": "2022-09-28T14:10:52.274Z", + "time": 495 }, { - "_id": "0d5ab55cf3b7ef3c7b723fc2e111fdc9", + "_id": "7e1777581e574f7470d4edd4151a0ad0", "_order": 0, "cache": {}, "request": { @@ -127,37 +127,36 @@ "value": "*/*" } ], - "headersSize": 548, + "headersSize": 546, "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/synthetics/variables/9dec05d1-27b9-4e16-9ec5-0305af3ac10a" + "url": "https://api.datadoghq.com/api/v1/synthetics/variables/4507df9b-a12d-4dfe-b020-c76d4e96d286" }, "response": { - "bodySize": 2, + "bodySize": 0, "content": { - "mimeType": "application/json", - "size": 2, - "text": "{}" + "mimeType": "text/html; charset=utf-8", + "size": 0 }, "cookies": [], "headers": [ { "name": "content-type", - "value": "application/json" + "value": "text/html; charset=utf-8" } ], - "headersSize": 641, + "headersSize": 605, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-08-30T12:58:49.857Z", - "time": 530 + "startedDateTime": "2022-09-28T14:10:52.777Z", + "time": 475 }, { - "_id": "debd38c6bd8887f8a52793d906ee4b55", + "_id": "c767bbcf1d98adc13f84dad576e9e3ed", "_order": 0, "cache": {}, "request": { @@ -175,23 +174,23 @@ "value": "application/json" } ], - "headersSize": 568, + "headersSize": 566, "httpVersion": "HTTP/1.1", "method": "POST", "postData": { "mimeType": "application/json", "params": [], - "text": "{\"public_ids\":[\"frc-8cs-fce\"]}" + "text": "{\"public_ids\":[\"nsx-pp5-8tb\"]}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/synthetics/tests/delete" }, "response": { - "bodySize": 95, + "bodySize": 96, "content": { "mimeType": "application/json", - "size": 95, - "text": "{\"deleted_tests\":[{\"deleted_at\":\"2022-08-30T12:58:55.803154+00:00\",\"public_id\":\"frc-8cs-fce\"}]}" + "size": 96, + "text": "{\"deleted_tests\":[{\"deleted_at\":\"2022-09-28T14:10:58.657679+00:00\",\"public_id\":\"nsx-pp5-8tb\"}]}\n" }, "cookies": [], "headers": [ @@ -200,14 +199,14 @@ "value": "application/json" } ], - "headersSize": 665, + "headersSize": 621, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-08-30T12:58:50.394Z", - "time": 5506 + "startedDateTime": "2022-09-28T14:10:53.262Z", + "time": 5583 } ], "pages": [], diff --git a/examples/v1/synthetics/CreateGlobalVariable_1068962881.ts b/examples/v1/synthetics/CreateGlobalVariable_1068962881.ts index 8dafc2b32486..8d94baaad1ba 100644 --- a/examples/v1/synthetics/CreateGlobalVariable_1068962881.ts +++ b/examples/v1/synthetics/CreateGlobalVariable_1068962881.ts @@ -14,7 +14,7 @@ const SYNTHETICS_API_TEST_MULTI_STEP_PUBLIC_ID = process.env const params: v1.SyntheticsApiCreateGlobalVariableRequest = { body: { description: "", - name: "GLOBAL_VARIABLE_PAYLOAD", + name: "GLOBAL_VARIABLE_PAYLOAD_EXAMPLECREATEAGLOBALVARIABLEFROMTESTRETURNSOKRESPONSE", tags: [], value: { secure: false, diff --git a/features/v1/synthetics.feature b/features/v1/synthetics.feature index 0d88a13d6d9e..0c0c7d6bc593 100644 --- a/features/v1/synthetics.feature +++ b/features/v1/synthetics.feature @@ -70,6 +70,7 @@ Feature: Synthetics And body from file "synthetics_global_variable_payload.json" When the request is sent Then the response status is 200 OK + And the response "name" is equal to "GLOBAL_VARIABLE_PAYLOAD_{{ unique_upper_alnum }}" @generated @skip @team:DataDog/synthetics-app Scenario: Create a global variable returns "Invalid request" response diff --git a/features/v1/synthetics_global_variable_payload.json b/features/v1/synthetics_global_variable_payload.json index cb9c8b2d8821..6dea6018761a 100644 --- a/features/v1/synthetics_global_variable_payload.json +++ b/features/v1/synthetics_global_variable_payload.json @@ -1,6 +1,6 @@ { "description": "", - "name": "GLOBAL_VARIABLE_PAYLOAD", + "name": "GLOBAL_VARIABLE_PAYLOAD_{{ unique_upper_alnum }}", "tags": [], "value": { "secure": false, From cde4123d60325304302fc89b2ddf682c015c5438 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 09:20:00 +0000 Subject: [PATCH 27/30] Regenerate client from commit 26eb8e8a of spec repo (#856) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 72 ++++--- .../frozen.json | 2 +- .../recording.har | 50 ++--- features/v1/given.json | 2 +- features/v1/service_level_objectives.feature | 1 + packages/datadog-api-client-v1/index.ts | 2 + .../models/ObjectSerializer.ts | 4 + .../models/SLOCreator.ts | 5 +- .../models/SearchSLOResponseDataAttributes.ts | 6 +- .../models/SearchServiceLevelObjective.ts | 137 +------------- .../SearchServiceLevelObjectiveAttributes.ts | 175 ++++++++++++++++++ .../models/SearchServiceLevelObjectiveData.ts | 61 ++++++ 13 files changed, 335 insertions(+), 190 deletions(-) create mode 100644 packages/datadog-api-client-v1/models/SearchServiceLevelObjectiveAttributes.ts create mode 100644 packages/datadog-api-client-v1/models/SearchServiceLevelObjectiveData.ts diff --git a/.apigentools-info b/.apigentools-info index 9532b8c2ac3e..e97689c210f0 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-28 16:41:33.701189", - "spec_repo_commit": "5c013ee5" + "regenerated": "2022-09-29 08:29:28.561387", + "spec_repo_commit": "26eb8e8a" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-28 16:41:33.713516", - "spec_repo_commit": "5c013ee5" + "regenerated": "2022-09-29 08:29:28.573375", + "spec_repo_commit": "26eb8e8a" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index af2a3b29abeb..b9301ef3c180 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -8755,7 +8755,8 @@ components: type: string id: description: User ID of the creator. - type: string + format: int64 + type: integer name: description: Name of the creator. type: string @@ -9882,7 +9883,7 @@ components: properties: facets: $ref: '#/components/schemas/SearchSLOResponseDataAttributesFacets' - slo: + slos: description: SLOs items: $ref: '#/components/schemas/SearchServiceLevelObjective' @@ -9963,12 +9964,14 @@ components: type: string last: description: Link to first page. + nullable: true type: string next: description: Link to the next page. type: string prev: description: Link to previous page. + nullable: true type: string self: description: Link to current page. @@ -10077,22 +10080,25 @@ components: - THIRTY_DAYS - NINETY_DAYS SearchServiceLevelObjective: + description: A service level objective data container. + properties: + data: + $ref: '#/components/schemas/SearchServiceLevelObjectiveData' + type: object + SearchServiceLevelObjectiveAttributes: description: 'A service level objective object includes a service level indicator, thresholds - for one or more timeframes, and metadata (`name`, `description`, `tags`, etc.).' + for one or more timeframes, and metadata (`name`, `description`, and `tags`).' properties: all_tags: description: 'A list of tags associated with this service level objective. - Always included in service level objective responses (but may be empty). - - Optional in create/update requests.' + Always included in service level objective responses (but may be empty).' example: - env:prod - app:core items: - description: A tag to apply to your SLO. type: string type: array created_at: @@ -10114,18 +10120,16 @@ components: Optional in create/update requests.' nullable: true type: string + env_tags: + description: Tags with the `env` tag key. + items: + type: string + type: array groups: description: 'A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. - - Included in service level objective responses if it is not empty. Optional - in - - create/update requests for monitor service level objectives, but may only - be - - used when then length of the `monitor_ids` field is one.' + Included in service level objective responses if it is not empty.' example: - env:prod - role:mysql @@ -10134,13 +10138,6 @@ components: type: string nullable: true type: array - id: - description: 'A unique identifier for the service level objective object. - - - Always included in service level objective responses.' - readOnly: true - type: string modified_at: description: 'Modification timestamp (UNIX time in seconds) @@ -10153,7 +10150,7 @@ components: description: 'A list of monitor ids that defines the scope of a monitor service level - objective. **Required if type is `monitor`**.' + objective.' items: description: A monitor ID. format: int64 @@ -10171,6 +10168,18 @@ components: type: array query: $ref: '#/components/schemas/SearchSLOQuery' + service_tags: + description: Tags with the `service` tag key. + items: + type: string + type: array + slo_type: + $ref: '#/components/schemas/SLOType' + team_tags: + description: Tags with the `team` tag key. + items: + type: string + type: array thresholds: description: 'The thresholds (timeframes and associated targets) for this service level @@ -10188,8 +10197,23 @@ components: items: $ref: '#/components/schemas/SearchSLOThreshold' type: array + type: object + SearchServiceLevelObjectiveData: + description: A service level objective ID and attributes. + properties: + attributes: + $ref: '#/components/schemas/SearchServiceLevelObjectiveAttributes' + id: + description: 'A unique identifier for the service level objective object. + + + Always included in service level objective responses.' + readOnly: true + type: string type: - $ref: '#/components/schemas/SLOType' + description: The type of the object, must be `slo`. + type: string + type: object Series: description: 'A metric to submit to Datadog. diff --git a/cassettes/v1/Service-Level-Objectives_139838558/Search-for-SLOs-returns-OK-response_1012169361/frozen.json b/cassettes/v1/Service-Level-Objectives_139838558/Search-for-SLOs-returns-OK-response_1012169361/frozen.json index 431e82f56f82..66b5210b2063 100644 --- a/cassettes/v1/Service-Level-Objectives_139838558/Search-for-SLOs-returns-OK-response_1012169361/frozen.json +++ b/cassettes/v1/Service-Level-Objectives_139838558/Search-for-SLOs-returns-OK-response_1012169361/frozen.json @@ -1 +1 @@ -"2022-05-18T09:37:24.480Z" +"2022-09-28T09:39:18.171Z" diff --git a/cassettes/v1/Service-Level-Objectives_139838558/Search-for-SLOs-returns-OK-response_1012169361/recording.har b/cassettes/v1/Service-Level-Objectives_139838558/Search-for-SLOs-returns-OK-response_1012169361/recording.har index b58421a26e44..143438b4435e 100644 --- a/cassettes/v1/Service-Level-Objectives_139838558/Search-for-SLOs-returns-OK-response_1012169361/recording.har +++ b/cassettes/v1/Service-Level-Objectives_139838558/Search-for-SLOs-returns-OK-response_1012169361/recording.har @@ -8,7 +8,7 @@ }, "entries": [ { - "_id": "ce1b99125afd22b2b6385ee4470ba88b", + "_id": "c4e48f7ef9a1e661ef7257e9a1929026", "_order": 0, "cache": {}, "request": { @@ -32,17 +32,17 @@ "postData": { "mimeType": "application/json", "params": [], - "text": "{\"name\":\"Test-Search_for_SLOs_returns_OK_response-1652866644\",\"query\":{\"denominator\":\"sum:httpservice.hits{!code:3xx}.as_count()\",\"numerator\":\"sum:httpservice.hits{code:2xx}.as_count()\"},\"thresholds\":[{\"target\":95,\"timeframe\":\"7d\",\"warning\":98}],\"type\":\"metric\"}" + "text": "{\"name\":\"Test-Search_for_SLOs_returns_OK_response-1664357958\",\"query\":{\"denominator\":\"sum:httpservice.hits{!code:3xx}.as_count()\",\"numerator\":\"sum:httpservice.hits{code:2xx}.as_count()\"},\"thresholds\":[{\"target\":95,\"timeframe\":\"7d\",\"warning\":98}],\"type\":\"metric\"}" }, "queryString": [], "url": "https://api.datadoghq.com/api/v1/slo" }, "response": { - "bodySize": 566, + "bodySize": 567, "content": { "mimeType": "application/json", - "size": 566, - "text": "{\"data\":[{\"description\":\"\",\"monitor_tags\":[],\"creator\":{\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"thresholds\":[{\"warning\":98.0,\"warning_display\":\"98.\",\"target\":95.0,\"target_display\":\"95.\",\"timeframe\":\"7d\"}],\"type_id\":1,\"query\":{\"denominator\":\"sum:httpservice.hits{!code:3xx}.as_count()\",\"numerator\":\"sum:httpservice.hits{code:2xx}.as_count()\"},\"id\":\"5ad30e05604756829cb664b58371aa9c\",\"name\":\"Test-Search_for_SLOs_returns_OK_response-1652866644\",\"created_at\":1652866645,\"tags\":[],\"modified_at\":1652866645,\"type\":\"metric\"}],\"error\":null}" + "size": 567, + "text": "{\"data\":[{\"description\":\"\",\"monitor_tags\":[],\"creator\":{\"handle\":\"frog@datadoghq.com\",\"name\":null,\"email\":\"frog@datadoghq.com\"},\"thresholds\":[{\"warning\":98.0,\"warning_display\":\"98.\",\"target\":95.0,\"target_display\":\"95.\",\"timeframe\":\"7d\"}],\"type_id\":1,\"query\":{\"denominator\":\"sum:httpservice.hits{!code:3xx}.as_count()\",\"numerator\":\"sum:httpservice.hits{code:2xx}.as_count()\"},\"id\":\"3e0865c5301c5271a3b4345eb4f14074\",\"name\":\"Test-Search_for_SLOs_returns_OK_response-1664357958\",\"created_at\":1664357958,\"tags\":[],\"modified_at\":1664357958,\"type\":\"metric\"}],\"error\":null}\n" }, "cookies": [], "headers": [ @@ -51,17 +51,17 @@ "value": "application/json" } ], - "headersSize": 662, + "headersSize": 618, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-18T09:37:24.494Z", - "time": 561 + "startedDateTime": "2022-09-28T09:39:18.181Z", + "time": 611 }, { - "_id": "68e37d4525d05ac2e5b409f9158488bb", + "_id": "d51df83c1bd72348f0fc1154dbe20f8d", "_order": 0, "cache": {}, "request": { @@ -80,7 +80,7 @@ "queryString": [ { "name": "query", - "value": "Test-Search_for_SLOs_returns_OK_response-1652866644" + "value": "Test-Search_for_SLOs_returns_OK_response-1664357958" }, { "name": "page", @@ -90,14 +90,14 @@ } } ], - "url": "https://api.datadoghq.com/api/v1/slo/search?query=Test-Search_for_SLOs_returns_OK_response-1652866644&page%5Bsize%5D=20&page%5Bnumber%5D=0" + "url": "https://api.datadoghq.com/api/v1/slo/search?query=Test-Search_for_SLOs_returns_OK_response-1664357958&page%5Bsize%5D=20&page%5Bnumber%5D=0" }, "response": { - "bodySize": 1379, + "bodySize": 1323, "content": { "mimeType": "application/json", - "size": 1379, - "text": "{\"meta\":{\"pagination\":{\"prev_number\":0,\"number\":0,\"last_number\":0,\"next_number\":1,\"first_number\":0,\"total\":1,\"type\":\"number_size\",\"size\":20}},\"data\":{\"attributes\":{\"facets\":{\"timeframe\":[{\"count\":1,\"name\":\"7d\"}],\"target\":[{\"count\":1,\"name\":95.0}],\"slo_type\":[{\"count\":1,\"name\":1}]},\"slos\":[{\"data\":{\"attributes\":{\"team_tags\":[],\"description\":null,\"creator\":{\"id\":1445416,\"email\":\"frog@datadoghq.com\",\"name\":null},\"created_at\":1652866645024787,\"env_tags\":[],\"modified_at\":1652866645024787,\"name\":\"Test-Search_for_SLOs_returns_OK_response-1652866644\",\"service_tags\":[],\"groups\":null,\"all_tags\":[],\"thresholds\":[{\"warning\":98.0,\"warning_display\":\"95\",\"target\":95.0,\"target_display\":\"95\",\"timeframe\":\"7d\"}],\"monitor_ids\":null,\"slo_type\":1},\"type\":\"slo\",\"id\":\"5ad30e05604756829cb664b58371aa9c\"}}]},\"type\":\"service_level_objective_search_results\"},\"links\":{\"next\":\"https://api.datadoghq.com/api/v1/slo/search?query=Test-Search_for_SLOs_returns_OK_response-1652866644&page%5Bsize%5D=20&page%5Bnumber%5D=0&page[number]=1&page[size]=20\",\"self\":\"https://api.datadoghq.com/api/v1/slo/search?query=Test-Search_for_SLOs_returns_OK_response-1652866644&page%5Bsize%5D=20&page%5Bnumber%5D=0\",\"prev\":null,\"last\":null,\"first\":\"https://api.datadoghq.com/api/v1/slo/search?query=Test-Search_for_SLOs_returns_OK_response-1652866644&page%5Bsize%5D=20&page%5Bnumber%5D=0&page[number]=0&page[size]=20\"}}" + "size": 1323, + "text": "{\"meta\":{\"pagination\":{\"prev_number\":0,\"number\":0,\"last_number\":0,\"next_number\":1,\"first_number\":0,\"total\":1,\"type\":\"number_size\",\"size\":20}},\"data\":{\"attributes\":{\"slos\":[{\"data\":{\"attributes\":{\"team_tags\":[],\"description\":null,\"creator\":{\"id\":1445416,\"email\":\"frog@datadoghq.com\",\"name\":null},\"created_at\":1664357958,\"env_tags\":[],\"modified_at\":1664357958,\"name\":\"Test-Search_for_SLOs_returns_OK_response-1664357958\",\"service_tags\":[],\"groups\":null,\"all_tags\":[],\"query\":{\"metrics\":null,\"denominator\":\"sum:httpservice.hits{!code:3xx}.as_count()\",\"numerator\":\"sum:httpservice.hits{code:2xx}.as_count()\"},\"thresholds\":[{\"warning\":98.0,\"warning_display\":\"95\",\"target\":95.0,\"target_display\":\"95\",\"timeframe\":\"7d\"}],\"monitor_ids\":null,\"slo_type\":\"metric\"},\"type\":\"slo\",\"id\":\"3e0865c5301c5271a3b4345eb4f14074\"}}]},\"type\":\"service_level_objective_search_results\"},\"links\":{\"next\":\"https://api.datadoghq.com/api/v1/slo/search?query=Test-Search_for_SLOs_returns_OK_response-1664357958&page[number]=1&page[size]=20\",\"self\":\"https://api.datadoghq.com/api/v1/slo/search?query=Test-Search_for_SLOs_returns_OK_response-1664357958&page%5Bsize%5D=20&page%5Bnumber%5D=0\",\"prev\":null,\"last\":null,\"first\":\"https://api.datadoghq.com/api/v1/slo/search?query=Test-Search_for_SLOs_returns_OK_response-1664357958&page[number]=0&page[size]=20\"}}\n" }, "cookies": [], "headers": [ @@ -106,17 +106,17 @@ "value": "application/json" } ], - "headersSize": 667, + "headersSize": 620, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-18T09:37:25.069Z", - "time": 1198 + "startedDateTime": "2022-09-28T09:39:20.823Z", + "time": 480 }, { - "_id": "d76bb8ca433a659b11ca805eb5f6a256", + "_id": "3f20ae90186fea9f9ca374fa44d311a9", "_order": 0, "cache": {}, "request": { @@ -133,14 +133,14 @@ "httpVersion": "HTTP/1.1", "method": "DELETE", "queryString": [], - "url": "https://api.datadoghq.com/api/v1/slo/5ad30e05604756829cb664b58371aa9c" + "url": "https://api.datadoghq.com/api/v1/slo/3e0865c5301c5271a3b4345eb4f14074" }, "response": { - "bodySize": 58, + "bodySize": 59, "content": { "mimeType": "application/json", - "size": 58, - "text": "{\"data\":[\"5ad30e05604756829cb664b58371aa9c\"],\"error\":null}" + "size": 59, + "text": "{\"data\":[\"3e0865c5301c5271a3b4345eb4f14074\"],\"error\":null}\n" }, "cookies": [], "headers": [ @@ -149,14 +149,14 @@ "value": "application/json" } ], - "headersSize": 662, + "headersSize": 616, "httpVersion": "HTTP/1.1", "redirectURL": "", "status": 200, "statusText": "OK" }, - "startedDateTime": "2022-05-18T09:37:26.277Z", - "time": 612 + "startedDateTime": "2022-09-28T09:39:21.320Z", + "time": 568 } ], "pages": [], diff --git a/features/v1/given.json b/features/v1/given.json index 68ec86779f4e..24adbd744211 100644 --- a/features/v1/given.json +++ b/features/v1/given.json @@ -195,7 +195,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"description\": \"\",\n \"name\": \"GLOBAL_VARIABLE_PAYLOAD\",\n \"tags\": [],\n \"value\": {\n \"secure\": false,\n \"value\": \"\"\n },\n \"parse_test_public_id\": \"{{ synthetics_api_test_multi_step.public_id }}\",\n \"parse_test_options\": {\n \"type\": \"local_variable\",\n \"localVariableName\": \"EXTRACTED_VALUE\"\n }\n}\n" + "value": "{\n \"description\": \"\",\n \"name\": \"GLOBAL_VARIABLE_PAYLOAD_{{ unique_upper_alnum }}\",\n \"tags\": [],\n \"value\": {\n \"secure\": false,\n \"value\": \"\"\n },\n \"parse_test_public_id\": \"{{ synthetics_api_test_multi_step.public_id }}\",\n \"parse_test_options\": {\n \"type\": \"local_variable\",\n \"localVariableName\": \"EXTRACTED_VALUE\"\n }\n}\n" } ], "step": "there is a valid \"synthetics_global_variable\" in the system", diff --git a/features/v1/service_level_objectives.feature b/features/v1/service_level_objectives.feature index e34ec8e0b545..7464b950be41 100644 --- a/features/v1/service_level_objectives.feature +++ b/features/v1/service_level_objectives.feature @@ -195,6 +195,7 @@ Feature: Service Level Objectives And request contains "page[number]" parameter with value 0 When the request is sent Then the response status is 200 OK + And the response "data.attributes.slos[0].data.attributes.name" is equal to "{{ slo.data[0].name }}" @team:DataDog/slo-app Scenario: Update an SLO returns "Bad Request" response diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index 6b8cda2def99..12ce3dc1d119 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -679,6 +679,8 @@ export { ScatterPlotWidgetDefinitionRequests } from "./models/ScatterPlotWidgetD export { ScatterPlotWidgetDefinitionType } from "./models/ScatterPlotWidgetDefinitionType"; export { ScatterplotWidgetFormula } from "./models/ScatterplotWidgetFormula"; export { SearchServiceLevelObjective } from "./models/SearchServiceLevelObjective"; +export { SearchServiceLevelObjectiveAttributes } from "./models/SearchServiceLevelObjectiveAttributes"; +export { SearchServiceLevelObjectiveData } from "./models/SearchServiceLevelObjectiveData"; export { SearchSLOQuery } from "./models/SearchSLOQuery"; export { SearchSLOResponse } from "./models/SearchSLOResponse"; export { SearchSLOResponseData } from "./models/SearchSLOResponseData"; diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index a4bd13692584..1aa814b02ac3 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -315,6 +315,8 @@ import { SearchSLOResponseMeta } from "./SearchSLOResponseMeta"; import { SearchSLOResponseMetaPage } from "./SearchSLOResponseMetaPage"; import { SearchSLOThreshold } from "./SearchSLOThreshold"; import { SearchServiceLevelObjective } from "./SearchServiceLevelObjective"; +import { SearchServiceLevelObjectiveAttributes } from "./SearchServiceLevelObjectiveAttributes"; +import { SearchServiceLevelObjectiveData } from "./SearchServiceLevelObjectiveData"; import { Series } from "./Series"; import { ServiceCheck } from "./ServiceCheck"; import { ServiceLevelObjective } from "./ServiceLevelObjective"; @@ -1636,6 +1638,8 @@ const typeMap: { [index: string]: any } = { SearchSLOResponseMetaPage: SearchSLOResponseMetaPage, SearchSLOThreshold: SearchSLOThreshold, SearchServiceLevelObjective: SearchServiceLevelObjective, + SearchServiceLevelObjectiveAttributes: SearchServiceLevelObjectiveAttributes, + SearchServiceLevelObjectiveData: SearchServiceLevelObjectiveData, Series: Series, ServiceCheck: ServiceCheck, ServiceLevelObjective: ServiceLevelObjective, diff --git a/packages/datadog-api-client-v1/models/SLOCreator.ts b/packages/datadog-api-client-v1/models/SLOCreator.ts index c2ec0041d4e5..1b5336ddf408 100644 --- a/packages/datadog-api-client-v1/models/SLOCreator.ts +++ b/packages/datadog-api-client-v1/models/SLOCreator.ts @@ -17,7 +17,7 @@ export class SLOCreator { /** * User ID of the creator. */ - "id"?: string; + "id"?: number; /** * Name of the creator. */ @@ -38,7 +38,8 @@ export class SLOCreator { }, id: { baseName: "id", - type: "string", + type: "number", + format: "int64", }, name: { baseName: "name", diff --git a/packages/datadog-api-client-v1/models/SearchSLOResponseDataAttributes.ts b/packages/datadog-api-client-v1/models/SearchSLOResponseDataAttributes.ts index 7285b2f158af..567745ea0be0 100644 --- a/packages/datadog-api-client-v1/models/SearchSLOResponseDataAttributes.ts +++ b/packages/datadog-api-client-v1/models/SearchSLOResponseDataAttributes.ts @@ -19,7 +19,7 @@ export class SearchSLOResponseDataAttributes { /** * SLOs */ - "slo"?: Array; + "slos"?: Array; /** * @ignore @@ -34,8 +34,8 @@ export class SearchSLOResponseDataAttributes { baseName: "facets", type: "SearchSLOResponseDataAttributesFacets", }, - slo: { - baseName: "slo", + slos: { + baseName: "slos", type: "Array", }, }; diff --git a/packages/datadog-api-client-v1/models/SearchServiceLevelObjective.ts b/packages/datadog-api-client-v1/models/SearchServiceLevelObjective.ts index a7b88e842f2a..a2f66b19f23c 100644 --- a/packages/datadog-api-client-v1/models/SearchServiceLevelObjective.ts +++ b/packages/datadog-api-client-v1/models/SearchServiceLevelObjective.ts @@ -3,90 +3,18 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ -import { SearchSLOQuery } from "./SearchSLOQuery"; -import { SearchSLOThreshold } from "./SearchSLOThreshold"; -import { SLOCreator } from "./SLOCreator"; -import { SLOOverallStatuses } from "./SLOOverallStatuses"; -import { SLOType } from "./SLOType"; +import { SearchServiceLevelObjectiveData } from "./SearchServiceLevelObjectiveData"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; /** - * A service level objective object includes a service level indicator, thresholds - * for one or more timeframes, and metadata (`name`, `description`, `tags`, etc.). + * A service level objective data container. */ export class SearchServiceLevelObjective { /** - * A list of tags associated with this service level objective. - * Always included in service level objective responses (but may be empty). - * Optional in create/update requests. + * A service level objective ID and attributes. */ - "allTags"?: Array; - /** - * Creation timestamp (UNIX time in seconds) - * - * Always included in service level objective responses. - */ - "createdAt"?: number; - /** - * The creator of the SLO - */ - "creator"?: SLOCreator; - /** - * A user-defined description of the service level objective. - * - * Always included in service level objective responses (but may be `null`). - * Optional in create/update requests. - */ - "description"?: string; - /** - * A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. - * - * Included in service level objective responses if it is not empty. Optional in - * create/update requests for monitor service level objectives, but may only be - * used when then length of the `monitor_ids` field is one. - */ - "groups"?: Array; - /** - * A unique identifier for the service level objective object. - * - * Always included in service level objective responses. - */ - "id"?: string; - /** - * Modification timestamp (UNIX time in seconds) - * - * Always included in service level objective responses. - */ - "modifiedAt"?: number; - /** - * A list of monitor ids that defines the scope of a monitor service level - * objective. **Required if type is `monitor`**. - */ - "monitorIds"?: Array; - /** - * The name of the service level objective object. - */ - "name"?: string; - /** - * calculated status and error budget remaining. - */ - "overallStatus"?: Array; - /** - * A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator - * to be used because this will sum up all request counts instead of averaging them, or taking the max or - * min of all of those requests. - */ - "query"?: SearchSLOQuery; - /** - * The thresholds (timeframes and associated targets) for this service level - * objective object. - */ - "thresholds"?: Array; - /** - * The type of the service level objective. - */ - "type"?: SLOType; + "data"?: SearchServiceLevelObjectiveData; /** * @ignore @@ -97,60 +25,9 @@ export class SearchServiceLevelObjective { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { - allTags: { - baseName: "all_tags", - type: "Array", - }, - createdAt: { - baseName: "created_at", - type: "number", - format: "int64", - }, - creator: { - baseName: "creator", - type: "SLOCreator", - }, - description: { - baseName: "description", - type: "string", - }, - groups: { - baseName: "groups", - type: "Array", - }, - id: { - baseName: "id", - type: "string", - }, - modifiedAt: { - baseName: "modified_at", - type: "number", - format: "int64", - }, - monitorIds: { - baseName: "monitor_ids", - type: "Array", - format: "int64", - }, - name: { - baseName: "name", - type: "string", - }, - overallStatus: { - baseName: "overall_status", - type: "Array", - }, - query: { - baseName: "query", - type: "SearchSLOQuery", - }, - thresholds: { - baseName: "thresholds", - type: "Array", - }, - type: { - baseName: "type", - type: "SLOType", + data: { + baseName: "data", + type: "SearchServiceLevelObjectiveData", }, }; diff --git a/packages/datadog-api-client-v1/models/SearchServiceLevelObjectiveAttributes.ts b/packages/datadog-api-client-v1/models/SearchServiceLevelObjectiveAttributes.ts new file mode 100644 index 000000000000..dd648b1b6050 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SearchServiceLevelObjectiveAttributes.ts @@ -0,0 +1,175 @@ +/** + * 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. + */ +import { SearchSLOQuery } from "./SearchSLOQuery"; +import { SearchSLOThreshold } from "./SearchSLOThreshold"; +import { SLOCreator } from "./SLOCreator"; +import { SLOOverallStatuses } from "./SLOOverallStatuses"; +import { SLOType } from "./SLOType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A service level objective object includes a service level indicator, thresholds + * for one or more timeframes, and metadata (`name`, `description`, and `tags`). + */ +export class SearchServiceLevelObjectiveAttributes { + /** + * A list of tags associated with this service level objective. + * Always included in service level objective responses (but may be empty). + */ + "allTags"?: Array; + /** + * Creation timestamp (UNIX time in seconds) + * + * Always included in service level objective responses. + */ + "createdAt"?: number; + /** + * The creator of the SLO + */ + "creator"?: SLOCreator; + /** + * A user-defined description of the service level objective. + * + * Always included in service level objective responses (but may be `null`). + * Optional in create/update requests. + */ + "description"?: string; + /** + * Tags with the `env` tag key. + */ + "envTags"?: Array; + /** + * A list of (up to 100) monitor groups that narrow the scope of a monitor service level objective. + * Included in service level objective responses if it is not empty. + */ + "groups"?: Array; + /** + * Modification timestamp (UNIX time in seconds) + * + * Always included in service level objective responses. + */ + "modifiedAt"?: number; + /** + * A list of monitor ids that defines the scope of a monitor service level + * objective. + */ + "monitorIds"?: Array; + /** + * The name of the service level objective object. + */ + "name"?: string; + /** + * calculated status and error budget remaining. + */ + "overallStatus"?: Array; + /** + * A metric-based SLO. **Required if type is `metric`**. Note that Datadog only allows the sum by aggregator + * to be used because this will sum up all request counts instead of averaging them, or taking the max or + * min of all of those requests. + */ + "query"?: SearchSLOQuery; + /** + * Tags with the `service` tag key. + */ + "serviceTags"?: Array; + /** + * The type of the service level objective. + */ + "sloType"?: SLOType; + /** + * Tags with the `team` tag key. + */ + "teamTags"?: Array; + /** + * The thresholds (timeframes and associated targets) for this service level + * objective object. + */ + "thresholds"?: Array; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + allTags: { + baseName: "all_tags", + type: "Array", + }, + createdAt: { + baseName: "created_at", + type: "number", + format: "int64", + }, + creator: { + baseName: "creator", + type: "SLOCreator", + }, + description: { + baseName: "description", + type: "string", + }, + envTags: { + baseName: "env_tags", + type: "Array", + }, + groups: { + baseName: "groups", + type: "Array", + }, + modifiedAt: { + baseName: "modified_at", + type: "number", + format: "int64", + }, + monitorIds: { + baseName: "monitor_ids", + type: "Array", + format: "int64", + }, + name: { + baseName: "name", + type: "string", + }, + overallStatus: { + baseName: "overall_status", + type: "Array", + }, + query: { + baseName: "query", + type: "SearchSLOQuery", + }, + serviceTags: { + baseName: "service_tags", + type: "Array", + }, + sloType: { + baseName: "slo_type", + type: "SLOType", + }, + teamTags: { + baseName: "team_tags", + type: "Array", + }, + thresholds: { + baseName: "thresholds", + type: "Array", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SearchServiceLevelObjectiveAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/SearchServiceLevelObjectiveData.ts b/packages/datadog-api-client-v1/models/SearchServiceLevelObjectiveData.ts new file mode 100644 index 000000000000..d6250f0988a9 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SearchServiceLevelObjectiveData.ts @@ -0,0 +1,61 @@ +/** + * 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. + */ +import { SearchServiceLevelObjectiveAttributes } from "./SearchServiceLevelObjectiveAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A service level objective ID and attributes. + */ +export class SearchServiceLevelObjectiveData { + /** + * A service level objective object includes a service level indicator, thresholds + * for one or more timeframes, and metadata (`name`, `description`, and `tags`). + */ + "attributes"?: SearchServiceLevelObjectiveAttributes; + /** + * A unique identifier for the service level objective object. + * + * Always included in service level objective responses. + */ + "id"?: string; + /** + * The type of the object, must be `slo`. + */ + "type"?: string; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SearchServiceLevelObjectiveAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "string", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SearchServiceLevelObjectiveData.attributeTypeMap; + } + + public constructor() {} +} From 237ba5cf9aa39d125e12332c71bac66149655c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Herv=C3=A9?= Date: Thu, 29 Sep 2022 13:19:31 +0200 Subject: [PATCH 28/30] Fix debug output (#857) Correctly handle compress and remove body from response log --- .../src/generator/templates/http/isomorphic-fetch.j2 | 9 ++------- .../datadog-api-client-common/http/isomorphic-fetch.ts | 9 ++------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.generator/src/generator/templates/http/isomorphic-fetch.j2 b/.generator/src/generator/templates/http/isomorphic-fetch.j2 index a9e2735477dd..a68572e00cea 100644 --- a/.generator/src/generator/templates/http/isomorphic-fetch.j2 +++ b/.generator/src/generator/templates/http/isomorphic-fetch.j2 @@ -90,7 +90,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { const body = request.getBody() ? JSON.stringify(request.getBody(), null, 2).replace(/\n/g, "\n\t") : ""; - const compress = request.getHttpConfig().compress || true; + const compress = request.getHttpConfig().compress ?? true; console.debug( "\nrequest: {\n", @@ -108,15 +108,10 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { /\n/g, "\n\t" ); - const body = response.body - ? JSON.stringify(response.body, null, 2).replace(/\n/g, "\n\t") - : ""; - console.debug( "response: {\n", `\tstatus: ${httpStatusCode}\n`, - `\theaders: ${headers}\n`, - `\tbody: ${body}\n}\n` + `\theaders: ${headers}\n` ); } } diff --git a/packages/datadog-api-client-common/http/isomorphic-fetch.ts b/packages/datadog-api-client-common/http/isomorphic-fetch.ts index 1b29be8c66c7..ea06e198e9eb 100644 --- a/packages/datadog-api-client-common/http/isomorphic-fetch.ts +++ b/packages/datadog-api-client-common/http/isomorphic-fetch.ts @@ -95,7 +95,7 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { const body = request.getBody() ? JSON.stringify(request.getBody(), null, 2).replace(/\n/g, "\n\t") : ""; - const compress = request.getHttpConfig().compress || true; + const compress = request.getHttpConfig().compress ?? true; console.debug( "\nrequest: {\n", @@ -113,15 +113,10 @@ export class IsomorphicFetchHttpLibrary implements HttpLibrary { /\n/g, "\n\t" ); - const body = response.body - ? JSON.stringify(response.body, null, 2).replace(/\n/g, "\n\t") - : ""; - console.debug( "response: {\n", `\tstatus: ${httpStatusCode}\n`, - `\theaders: ${headers}\n`, - `\tbody: ${body}\n}\n` + `\theaders: ${headers}\n` ); } } From 8e5893f129d85eca78ed21295b6610f0ef4c6e4c Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 16:10:39 +0000 Subject: [PATCH 29/30] Regenerate client from commit e57e3c55 of spec repo (#852) Co-authored-by: ci.datadog-api-spec --- .apigentools-info | 8 +- .generator/schemas/v2/openapi.yaml | 386 +++++++++++++++++- .../frozen.json | 1 + .../recording.har | 162 ++++++++ .../frozen.json | 1 + .../recording.har | 205 ++++++++++ .../v2/incidents/ListIncidentAttachments.ts | 22 + .../ListIncidentAttachments_2457735435.ts | 25 ++ .../v2/incidents/UpdateIncidentAttachments.ts | 51 +++ .../UpdateIncidentAttachments_3881702075.ts | 39 ++ features/v2/given.json | 16 + features/v2/incidents.feature | 73 ++++ features/v2/undo.json | 12 + .../configuration.ts | 2 + .../apis/IncidentsApi.ts | 362 ++++++++++++++++ packages/datadog-api-client-v2/index.ts | 22 + .../IncidentAttachmentAttachmentType.ts | 9 + .../models/IncidentAttachmentAttributes.ts | 18 + .../models/IncidentAttachmentData.ts | 72 ++++ .../IncidentAttachmentLinkAttachmentType.ts | 8 + .../IncidentAttachmentLinkAttributes.ts | 53 +++ ...ttachmentLinkAttributesAttachmentObject.ts | 51 +++ ...identAttachmentPostmortemAttachmentType.ts | 8 + .../IncidentAttachmentPostmortemAttributes.ts | 53 +++ .../models/IncidentAttachmentRelatedObject.ts | 8 + .../models/IncidentAttachmentRelationships.ts | 42 ++ .../models/IncidentAttachmentType.ts | 8 + .../IncidentAttachmentUpdateAttributes.ts | 18 + .../models/IncidentAttachmentUpdateData.ts | 60 +++ .../models/IncidentAttachmentUpdateRequest.ts | 46 +++ .../IncidentAttachmentUpdateResponse.ts | 53 +++ ...ntsPostmortemAttributesAttachmentObject.ts | 51 +++ .../models/IncidentAttachmentsResponse.ts | 52 +++ ...IncidentAttachmentsResponseIncludedItem.ts | 14 + .../models/IncidentRelatedObject.ts | 3 +- .../models/IncidentResponseAttributes.ts | 8 - .../models/IncidentResponseIncludedItem.ts | 6 +- .../models/IncidentResponseRelationships.ts | 18 +- .../models/ObjectSerializer.ts | 45 +- .../RelationshipToIncidentAttachment.ts | 43 ++ .../RelationshipToIncidentAttachmentData.ts | 52 +++ 41 files changed, 2145 insertions(+), 41 deletions(-) create mode 100644 cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/frozen.json create mode 100644 cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/recording.har create mode 100644 cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/frozen.json create mode 100644 cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/recording.har create mode 100644 examples/v2/incidents/ListIncidentAttachments.ts create mode 100644 examples/v2/incidents/ListIncidentAttachments_2457735435.ts create mode 100644 examples/v2/incidents/UpdateIncidentAttachments.ts create mode 100644 examples/v2/incidents/UpdateIncidentAttachments_3881702075.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentAttachmentType.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentData.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttachmentType.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributesAttachmentObject.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttachmentType.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentRelatedObject.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentType.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentUpdateAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentUpdateData.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentUpdateRequest.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentUpdateResponse.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentsPostmortemAttributesAttachmentObject.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentsResponse.ts create mode 100644 packages/datadog-api-client-v2/models/IncidentAttachmentsResponseIncludedItem.ts create mode 100644 packages/datadog-api-client-v2/models/RelationshipToIncidentAttachment.ts create mode 100644 packages/datadog-api-client-v2/models/RelationshipToIncidentAttachmentData.ts diff --git a/.apigentools-info b/.apigentools-info index e97689c210f0..f3e19f8977f4 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-29 08:29:28.561387", - "spec_repo_commit": "26eb8e8a" + "regenerated": "2022-09-29 15:48:27.293105", + "spec_repo_commit": "e57e3c55" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2022-09-29 08:29:28.573375", - "spec_repo_commit": "26eb8e8a" + "regenerated": "2022-09-29 15:48:27.304947", + "spec_repo_commit": "e57e3c55" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a0ac7e9a3d2c..7633bb9d6101 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -145,6 +145,26 @@ components: required: true schema: type: string + IncidentAttachmentFilterQueryParameter: + description: Specifies which types of attachments are included in the response. + explode: false + in: query + name: filter[attachment_type] + required: false + schema: + items: + $ref: '#/components/schemas/IncidentAttachmentAttachmentType' + type: array + IncidentAttachmentIncludeQueryParameter: + description: Specifies which types of related objects are included in the response. + explode: false + in: query + name: include + required: false + schema: + items: + $ref: '#/components/schemas/IncidentAttachmentRelatedObject' + type: array IncidentIDPathParameter: description: The UUID of the incident. in: path @@ -2114,6 +2134,243 @@ components: type: string x-mimetype: application/xml type: object + IncidentAttachmentAttachmentType: + description: The type of the incident attachment attributes. + enum: + - link + - postmortem + example: link + type: string + x-enum-varnames: + - LINK + - POSTMORTEM + IncidentAttachmentAttributes: + description: The attributes object for an attachment. + oneOf: + - $ref: '#/components/schemas/IncidentAttachmentPostmortemAttributes' + - $ref: '#/components/schemas/IncidentAttachmentLinkAttributes' + type: object + IncidentAttachmentData: + description: A single incident attachment. + example: + attributes: + attachment: + documentUrl: '' + title: Postmortem IR-123 + attachment_type: postmortem + id: 00000000-abcd-0002-0000-000000000000 + relationships: + last_modified_by_user: + data: + id: 00000000-0000-0000-cccc-000000000000 + type: users + type: incident_attachments + properties: + attributes: + $ref: '#/components/schemas/IncidentAttachmentAttributes' + id: + description: A unique identifier that represents the incident attachment. + example: 00000000-abcd-0001-0000-000000000000 + type: string + relationships: + $ref: '#/components/schemas/IncidentAttachmentRelationships' + type: + $ref: '#/components/schemas/IncidentAttachmentType' + required: + - type + - attributes + - id + - relationships + type: object + IncidentAttachmentLinkAttachmentType: + default: link + description: The type of link attachment attributes. + enum: + - link + example: link + type: string + x-enum-varnames: + - LINK + IncidentAttachmentLinkAttributes: + description: The attributes object for a link attachment. + properties: + attachment: + $ref: '#/components/schemas/IncidentAttachmentLinkAttributesAttachmentObject' + attachment_type: + $ref: '#/components/schemas/IncidentAttachmentLinkAttachmentType' + required: + - attachment_type + - attachment + type: object + IncidentAttachmentLinkAttributesAttachmentObject: + description: The link attachment. + properties: + documentUrl: + description: The URL of this link attachment. + example: https://www.example.com/webstore-failure-runbook + type: string + title: + description: The title of this link attachment. + example: Runbook for webstore service failures + type: string + required: + - documentUrl + - title + type: object + IncidentAttachmentPostmortemAttachmentType: + default: postmortem + description: The type of postmortem attachment attributes. + enum: + - postmortem + example: postmortem + type: string + x-enum-varnames: + - POSTMORTEM + IncidentAttachmentPostmortemAttributes: + description: The attributes object for a postmortem attachment. + properties: + attachment: + $ref: '#/components/schemas/IncidentAttachmentsPostmortemAttributesAttachmentObject' + attachment_type: + $ref: '#/components/schemas/IncidentAttachmentPostmortemAttachmentType' + required: + - attachment_type + - attachment + type: object + IncidentAttachmentRelatedObject: + description: The object related to an incident attachment. + enum: + - users + type: string + x-enum-varnames: + - USERS + IncidentAttachmentRelationships: + description: The incident attachment's relationships. + properties: + last_modified_by_user: + $ref: '#/components/schemas/RelationshipToUser' + type: object + IncidentAttachmentType: + default: incident_attachments + description: The incident attachment resource type. + enum: + - incident_attachments + example: incident_attachments + type: string + x-enum-varnames: + - INCIDENT_ATTACHMENTS + IncidentAttachmentUpdateAttributes: + description: Incident attachment attributes. + oneOf: + - $ref: '#/components/schemas/IncidentAttachmentPostmortemAttributes' + - $ref: '#/components/schemas/IncidentAttachmentLinkAttributes' + type: object + IncidentAttachmentUpdateData: + description: A single incident attachment. + properties: + attributes: + $ref: '#/components/schemas/IncidentAttachmentUpdateAttributes' + id: + description: A unique identifier that represents the incident attachment. + example: 00000000-abcd-0001-0000-000000000000 + type: string + type: + $ref: '#/components/schemas/IncidentAttachmentType' + required: + - type + type: object + IncidentAttachmentUpdateRequest: + description: The update request for an incident's attachments. + properties: + data: + description: 'An array of incident attachments. An attachment object without + an "id" key indicates that you want to + + create that attachment. An attachment object without an "attributes" key + indicates that you want to + + delete that attachment. An attachment object with both the "id" key and + a populated "attributes" object + + indicates that you want to update that attachment.' + example: + - attributes: + attachment: + documentUrl: https://app.datadoghq.com/notebook/123 + title: Postmortem IR-123 + attachment_type: postmortem + id: 00000000-abcd-0002-0000-000000000000 + type: incident_attachments + - attributes: + attachment: + documentUrl: https://www.example.com/webstore-failure-runbook + title: Runbook for webstore service failures + attachment_type: link + type: incident_attachments + - id: 00000000-abcd-0003-0000-000000000000 + type: incident_attachments + items: + $ref: '#/components/schemas/IncidentAttachmentUpdateData' + type: array + required: + - data + type: object + IncidentAttachmentUpdateResponse: + description: The response object containing the created or updated incident + attachments. + properties: + data: + description: 'An array of incident attachments. Only the attachments that + were created or updated by the request are + + returned.' + items: + $ref: '#/components/schemas/IncidentAttachmentData' + type: array + included: + description: Included related resources that the user requested. + items: + $ref: '#/components/schemas/IncidentAttachmentsResponseIncludedItem' + type: array + required: + - data + type: object + IncidentAttachmentsPostmortemAttributesAttachmentObject: + description: The postmortem attachment. + properties: + documentUrl: + description: The URL of this notebook attachment. + example: https://app.datadoghq.com/notebook/123 + type: string + title: + description: The title of this postmortem attachment. + example: Postmortem IR-123 + type: string + required: + - documentUrl + - title + type: object + IncidentAttachmentsResponse: + description: The response object containing an incident's attachments. + properties: + data: + description: An array of incident attachments. + items: + $ref: '#/components/schemas/IncidentAttachmentData' + type: array + included: + description: Included related resources that the user requested. + items: + $ref: '#/components/schemas/IncidentAttachmentsResponseIncludedItem' + type: array + required: + - data + type: object + IncidentAttachmentsResponseIncludedItem: + description: An object related to an attachment that is included in the response. + oneOf: + - $ref: '#/components/schemas/User' + type: object IncidentCreateAttributes: description: The incident's attributes for a create request. properties: @@ -2278,9 +2535,11 @@ components: description: Object related to an incident. enum: - users + - attachments type: string x-enum-varnames: - USERS + - ATTACHMENTS IncidentResponse: description: Response with an incident. properties: @@ -2355,10 +2614,6 @@ components: $ref: '#/components/schemas/IncidentNotificationHandle' nullable: true type: array - postmortem_id: - description: The UUID of the postmortem object attached to the incident. - example: 00000000-0000-0000-7890-000000000000 - type: string public_id: description: The monotonically increasing integer ID for the incident. example: 1 @@ -2423,6 +2678,7 @@ components: description: An object related to an incident that is included in the response. oneOf: - $ref: '#/components/schemas/User' + - $ref: '#/components/schemas/IncidentAttachmentData' type: object IncidentResponseMeta: description: The metadata object containing pagination metadata. @@ -2454,6 +2710,8 @@ components: IncidentResponseRelationships: description: The incident's relationships from a response. properties: + attachments: + $ref: '#/components/schemas/RelationshipToIncidentAttachment' commander_user: $ref: '#/components/schemas/NullableRelationshipToUser' created_by_user: @@ -2462,8 +2720,6 @@ components: $ref: '#/components/schemas/RelationshipToIncidentIntegrationMetadatas' last_modified_by_user: $ref: '#/components/schemas/RelationshipToUser' - postmortem: - $ref: '#/components/schemas/RelationshipToIncidentPostmortem' type: object IncidentServiceCreateAttributes: description: The incident service's attributes for a create request. @@ -2934,7 +3190,6 @@ components: customer_impacted: false detected: '2020-04-14T00:00:00+00:00' modified: '2020-09-17T14:16:58.696424+00:00' - postmortem_id: 00000000-0000-bbbb-0000-000000000000 public_id: 1 resolved: null severity: SEV-1 @@ -2945,6 +3200,12 @@ components: title: Example Incident id: 00000000-aaaa-0000-0000-000000000000 relationships: + attachments: + data: + - id: 00000000-9999-0000-0000-000000000000 + type: incident_attachments + - id: 00000000-1234-0000-0000-000000000000 + type: incident_attachments commander_user: data: id: 00000000-0000-0000-cccc-000000000000 @@ -2963,10 +3224,6 @@ components: data: id: 00000000-0000-0000-cccc-000000000000 type: users - postmortem: - data: - id: 00000000-9999-0000-0000-000000000000 - type: incident_postmortems type: incidents - attributes: created: '2020-04-21T15:34:08.627205+00:00' @@ -2978,7 +3235,6 @@ components: customer_impacted: false detected: '2020-04-14T00:00:00+00:00' modified: '2020-09-17T14:16:58.696424+00:00' - postmortem_id: 00000000-6006-0000-0000-000000000000 public_id: 2 resolved: null severity: SEV-5 @@ -2989,6 +3245,10 @@ components: title: Example Incident 2 id: 00000000-1111-0000-0000-000000000000 relationships: + attachments: + data: + - id: 00000000-9999-0000-0000-000000000000 + type: incident_attachments commander_user: data: id: 00000000-aaaa-0000-0000-000000000000 @@ -3007,10 +3267,6 @@ components: data: id: 00000000-aaaa-0000-0000-000000000000 type: users - postmortem: - data: - id: 00000000-6006-0000-0000-000000000000 - type: incident_postmortems type: incidents items: $ref: '#/components/schemas/IncidentResponseData' @@ -6197,6 +6453,30 @@ components: from the other indexes type: string type: object + RelationshipToIncidentAttachment: + description: A relationship reference for attachments. + properties: + data: + description: An array of incident attachments. + items: + $ref: '#/components/schemas/RelationshipToIncidentAttachmentData' + type: array + required: + - data + type: object + RelationshipToIncidentAttachmentData: + description: The attachment relationship data. + properties: + id: + description: A unique identifier that represents the attachment. + example: 00000000-0000-abcd-1000-000000000000 + type: string + type: + $ref: '#/components/schemas/IncidentAttachmentType' + required: + - id + - type + type: object RelationshipToIncidentIntegrationMetadataData: description: A relationship reference for an integration metadata object. example: @@ -9786,6 +10066,80 @@ paths: x-unstable: '**Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/incidents/{incident_id}/attachments: + get: + description: Get all attachments for a given incident. + operationId: ListIncidentAttachments + parameters: + - $ref: '#/components/parameters/IncidentIDPathParameter' + - $ref: '#/components/parameters/IncidentAttachmentIncludeQueryParameter' + - $ref: '#/components/parameters/IncidentAttachmentFilterQueryParameter' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentAttachmentsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: Get a list of attachments + tags: + - Incidents + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: The bulk update endpoint for creating, updating, and deleting attachments + for a given incident. + operationId: UpdateIncidentAttachments + parameters: + - $ref: '#/components/parameters/IncidentIDPathParameter' + - $ref: '#/components/parameters/IncidentAttachmentIncludeQueryParameter' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentAttachmentUpdateRequest' + description: Incident Attachment Payload. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/IncidentAttachmentUpdateResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create, update, and delete incident attachments + tags: + - Incidents + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/integration/opsgenie/services: get: description: Get a list of all services from the Datadog Opsgenie integration. diff --git a/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/frozen.json b/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/frozen.json new file mode 100644 index 000000000000..b4028d10baca --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/frozen.json @@ -0,0 +1 @@ +"2022-09-26T21:17:23.851Z" diff --git a/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/recording.har b/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/recording.har new file mode 100644 index 000000000000..b99e1395a454 --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Create-an-incident-attachment-returns-OK-response_3550971477/recording.har @@ -0,0 +1,162 @@ +{ + "log": { + "_recordingName": "Incidents/Create an incident attachment returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "34e2294593e4659222a0fd0b02378810", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 146, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 558, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"customer_impacted\":false,\"title\":\"Test-Create_an_incident_attachment_returns_OK_response-1664227043\"},\"type\":\"incidents\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents" + }, + "response": { + "bodySize": 2650, + "content": { + "mimeType": "application/json", + "size": 2650, + "text": "{\"data\":{\"type\":\"incidents\",\"id\":\"96fe3f0e-ee19-5e91-8eb8-324c9b4af1cf\",\"attributes\":{\"public_id\":106581,\"title\":\"Test-Create_an_incident_attachment_returns_OK_response-1664227043\",\"resolved\":null,\"customer_impact_scope\":null,\"customer_impact_start\":null,\"customer_impact_end\":null,\"customer_impacted\":false,\"notification_handles\":null,\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":null,\"created\":\"2022-09-26T21:17:24.154561+00:00\",\"modified\":\"2022-09-26T21:17:24.154561+00:00\",\"commander\":null,\"detected\":\"2022-09-26T21:17:24.145418+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":null,\"creation_idempotency_key\":null,\"customer_impact_duration\":0,\"time_to_detect\":0,\"time_to_repair\":0,\"time_to_internal_response\":0,\"time_to_resolve\":0,\"fields\":{\"severity\":{\"type\":\"dropdown\",\"value\":\"UNKNOWN\"},\"detection_method\":{\"type\":\"dropdown\",\"value\":\"unknown\"},\"root_cause\":{\"type\":\"textbox\",\"value\":null},\"teams\":{\"type\":\"autocomplete\",\"value\":null},\"state\":{\"type\":\"dropdown\",\"value\":\"active\"},\"services\":{\"type\":\"autocomplete\",\"value\":null},\"summary\":{\"type\":\"textbox\",\"value\":null}},\"field_analytics\":null,\"severity\":\"UNKNOWN\",\"state\":\"active\",\"non_datadog_creator\":null,\"visibility\":\"organization\"},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"commander_user\":{\"data\":null},\"user_defined_fields\":{\"data\":[{\"type\":\"user_defined_field\",\"id\":\"4148ead2-da45-548e-b6be-8e319bafc425\"},{\"type\":\"user_defined_field\",\"id\":\"66b62f59-48f6-5fee-969a-0886b1db6dcd\"},{\"type\":\"user_defined_field\",\"id\":\"299616f7-8acd-5403-886b-991656d6b982\"},{\"type\":\"user_defined_field\",\"id\":\"ad2b9456-eaec-5bbd-9bae-e502d74e23f8\"},{\"type\":\"user_defined_field\",\"id\":\"d8a54f16-8b2a-5ab4-87b8-5f0fa575c83e\"},{\"type\":\"user_defined_field\",\"id\":\"623af0a5-f30c-577e-8146-09b8324bdb2d\"},{\"type\":\"user_defined_field\",\"id\":\"ccfc9e6c-f586-58e5-b502-03c466c72e6f\"}]},\"integrations\":{\"data\":[]},\"attachments\":{\"data\":[]},\"responders\":{\"data\":[]},\"impacts\":{\"data\":[]}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 639, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2022-09-26T21:17:23.871Z", + "time": 525 + }, + { + "_id": "adc9ccd0b8ff58ce2895c38b8f79ccaf", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 217, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 619, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":[{\"attributes\":{\"attachment\":{\"documentUrl\":\"https://www.example.com/doc\",\"title\":\"Test-Create_an_incident_attachment_returns_OK_response-1664227043\"},\"attachment_type\":\"link\"},\"type\":\"incident_attachments\"}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/96fe3f0e-ee19-5e91-8eb8-324c9b4af1cf/attachments" + }, + "response": { + "bodySize": 420, + "content": { + "mimeType": "application/json", + "size": 420, + "text": "{\"data\":[{\"type\":\"incident_attachments\",\"id\":\"fead2659-92bf-543d-beca-0b90fb42c5df\",\"attributes\":{\"modified\":\"2022-09-26T21:17:24.650927+00:00\",\"attachment_type\":\"link\",\"attachment\":{\"documentUrl\":\"https://www.example.com/doc\",\"title\":\"Test-Create_an_incident_attachment_returns_OK_response-1664227043\"}},\"relationships\":{\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 655, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-26T21:17:24.405Z", + "time": 442 + }, + { + "_id": "e1d298d0b55cc078f064dc42b2c151d3", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 531, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/96fe3f0e-ee19-5e91-8eb8-324c9b4af1cf" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 621, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2022-09-26T21:17:24.856Z", + "time": 345 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/frozen.json b/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/frozen.json new file mode 100644 index 000000000000..d9a4f28cd701 --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/frozen.json @@ -0,0 +1 @@ +"2022-09-26T21:17:25.250Z" diff --git a/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/recording.har b/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/recording.har new file mode 100644 index 000000000000..fb22792f12c5 --- /dev/null +++ b/cassettes/v2/Incidents_2863714588/Get-incident-attachments-returns-OK-response_106175775/recording.har @@ -0,0 +1,205 @@ +{ + "log": { + "_recordingName": "Incidents/Get incident attachments returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "39ab6de9f326b1b0c069cbd51c17d371", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 141, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 557, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"customer_impacted\":false,\"title\":\"Test-Get_incident_attachments_returns_OK_response-1664227045\"},\"type\":\"incidents\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents" + }, + "response": { + "bodySize": 2645, + "content": { + "mimeType": "application/json", + "size": 2645, + "text": "{\"data\":{\"type\":\"incidents\",\"id\":\"762590df-8e28-5b77-8282-a51ec6aff95f\",\"attributes\":{\"public_id\":106582,\"title\":\"Test-Get_incident_attachments_returns_OK_response-1664227045\",\"resolved\":null,\"customer_impact_scope\":null,\"customer_impact_start\":null,\"customer_impact_end\":null,\"customer_impacted\":false,\"notification_handles\":null,\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"last_modified_by_uuid\":null,\"created\":\"2022-09-26T21:17:25.438704+00:00\",\"modified\":\"2022-09-26T21:17:25.438704+00:00\",\"commander\":null,\"detected\":\"2022-09-26T21:17:25.429904+00:00\",\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"uuid\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"handle\":\"frog@datadoghq.com\",\"email\":\"frog@datadoghq.com\",\"name\":null,\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\"}}},\"created_by_uuid\":null,\"creation_idempotency_key\":null,\"customer_impact_duration\":0,\"time_to_detect\":0,\"time_to_repair\":0,\"time_to_internal_response\":0,\"time_to_resolve\":0,\"fields\":{\"severity\":{\"type\":\"dropdown\",\"value\":\"UNKNOWN\"},\"detection_method\":{\"type\":\"dropdown\",\"value\":\"unknown\"},\"root_cause\":{\"type\":\"textbox\",\"value\":null},\"teams\":{\"type\":\"autocomplete\",\"value\":null},\"state\":{\"type\":\"dropdown\",\"value\":\"active\"},\"services\":{\"type\":\"autocomplete\",\"value\":null},\"summary\":{\"type\":\"textbox\",\"value\":null}},\"field_analytics\":null,\"severity\":\"UNKNOWN\",\"state\":\"active\",\"non_datadog_creator\":null,\"visibility\":\"organization\"},\"relationships\":{\"created_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"commander_user\":{\"data\":null},\"user_defined_fields\":{\"data\":[{\"type\":\"user_defined_field\",\"id\":\"4148ead2-da45-548e-b6be-8e319bafc425\"},{\"type\":\"user_defined_field\",\"id\":\"66b62f59-48f6-5fee-969a-0886b1db6dcd\"},{\"type\":\"user_defined_field\",\"id\":\"299616f7-8acd-5403-886b-991656d6b982\"},{\"type\":\"user_defined_field\",\"id\":\"ad2b9456-eaec-5bbd-9bae-e502d74e23f8\"},{\"type\":\"user_defined_field\",\"id\":\"d8a54f16-8b2a-5ab4-87b8-5f0fa575c83e\"},{\"type\":\"user_defined_field\",\"id\":\"623af0a5-f30c-577e-8146-09b8324bdb2d\"},{\"type\":\"user_defined_field\",\"id\":\"ccfc9e6c-f586-58e5-b502-03c466c72e6f\"}]},\"integrations\":{\"data\":[]},\"attachments\":{\"data\":[]},\"responders\":{\"data\":[]},\"impacts\":{\"data\":[]}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 639, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 201, + "statusText": "Created" + }, + "startedDateTime": "2022-09-26T21:17:25.254Z", + "time": 407 + }, + { + "_id": "d9bed400cfe774b8ab43c3b8e88183e2", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 165, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 618, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":[{\"attributes\":{\"attachment\":{\"documentUrl\":\"https://www.example.com/doc\",\"title\":\"Important Doc\"},\"attachment_type\":\"link\"},\"type\":\"incident_attachments\"}]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/762590df-8e28-5b77-8282-a51ec6aff95f/attachments" + }, + "response": { + "bodySize": 368, + "content": { + "mimeType": "application/json", + "size": 368, + "text": "{\"data\":[{\"type\":\"incident_attachments\",\"id\":\"c383d7df-3f44-571c-922a-4668ce53a8ad\",\"attributes\":{\"modified\":\"2022-09-26T21:17:25.906466+00:00\",\"attachment_type\":\"link\",\"attachment\":{\"documentUrl\":\"https://www.example.com/doc\",\"title\":\"Important Doc\"}},\"relationships\":{\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 655, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-26T21:17:25.668Z", + "time": 364 + }, + { + "_id": "ddb8615ea73f55f6a54e30838e6b95a7", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 561, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/762590df-8e28-5b77-8282-a51ec6aff95f/attachments" + }, + "response": { + "bodySize": 368, + "content": { + "mimeType": "application/json", + "size": 368, + "text": "{\"data\":[{\"type\":\"incident_attachments\",\"id\":\"c383d7df-3f44-571c-922a-4668ce53a8ad\",\"attributes\":{\"modified\":\"2022-09-26T21:17:25.906466+00:00\",\"attachment_type\":\"link\",\"attachment\":{\"documentUrl\":\"https://www.example.com/doc\",\"title\":\"Important Doc\"}},\"relationships\":{\"last_modified_by_user\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 653, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-09-26T21:17:26.037Z", + "time": 220 + }, + { + "_id": "85ad43da149f152759467f000fcbc5cb", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 530, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/incidents/762590df-8e28-5b77-8282-a51ec6aff95f" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/html; charset=utf-8", + "size": 0 + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "text/html; charset=utf-8" + } + ], + "headersSize": 621, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2022-09-26T21:17:26.266Z", + "time": 350 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v2/incidents/ListIncidentAttachments.ts b/examples/v2/incidents/ListIncidentAttachments.ts new file mode 100644 index 000000000000..677570486855 --- /dev/null +++ b/examples/v2/incidents/ListIncidentAttachments.ts @@ -0,0 +1,22 @@ +/** + * Get a list of attachments returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listIncidentAttachments"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +const params: v2.IncidentsApiListIncidentAttachmentsRequest = { + incidentId: "incident_id", +}; + +apiInstance + .listIncidentAttachments(params) + .then((data: v2.IncidentAttachmentsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/ListIncidentAttachments_2457735435.ts b/examples/v2/incidents/ListIncidentAttachments_2457735435.ts new file mode 100644 index 000000000000..8e728502881c --- /dev/null +++ b/examples/v2/incidents/ListIncidentAttachments_2457735435.ts @@ -0,0 +1,25 @@ +/** + * Get incident attachments returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.listIncidentAttachments"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +// there is a valid "incident" in the system +const INCIDENT_DATA_ID = process.env.INCIDENT_DATA_ID as string; + +const params: v2.IncidentsApiListIncidentAttachmentsRequest = { + incidentId: INCIDENT_DATA_ID, +}; + +apiInstance + .listIncidentAttachments(params) + .then((data: v2.IncidentAttachmentsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/UpdateIncidentAttachments.ts b/examples/v2/incidents/UpdateIncidentAttachments.ts new file mode 100644 index 000000000000..00dc1964e9db --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentAttachments.ts @@ -0,0 +1,51 @@ +/** + * Create, update, and delete incident attachments returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.updateIncidentAttachments"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +const params: v2.IncidentsApiUpdateIncidentAttachmentsRequest = { + body: { + data: [ + { + attributes: { + attachment: { + documentUrl: "https://app.datadoghq.com/notebook/123", + title: "Postmortem IR-123", + }, + attachmentType: "postmortem", + }, + id: "00000000-abcd-0002-0000-000000000000", + type: "incident_attachments", + }, + { + attributes: { + attachment: { + documentUrl: "https://www.example.com/webstore-failure-runbook", + title: "Runbook for webstore service failures", + }, + attachmentType: "link", + }, + type: "incident_attachments", + }, + { + id: "00000000-abcd-0003-0000-000000000000", + type: "incident_attachments", + }, + ], + }, + incidentId: "incident_id", +}; + +apiInstance + .updateIncidentAttachments(params) + .then((data: v2.IncidentAttachmentUpdateResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/incidents/UpdateIncidentAttachments_3881702075.ts b/examples/v2/incidents/UpdateIncidentAttachments_3881702075.ts new file mode 100644 index 000000000000..278b704bf754 --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentAttachments_3881702075.ts @@ -0,0 +1,39 @@ +/** + * Create an incident attachment returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.updateIncidentAttachments"] = true; +const apiInstance = new v2.IncidentsApi(configuration); + +// there is a valid "incident" in the system +const INCIDENT_DATA_ID = process.env.INCIDENT_DATA_ID as string; + +const params: v2.IncidentsApiUpdateIncidentAttachmentsRequest = { + body: { + data: [ + { + type: "incident_attachments", + attributes: { + attachmentType: "link", + attachment: { + documentUrl: "https://www.example.com/doc", + title: "Example-Create_an_incident_attachment_returns_OK_response", + }, + }, + }, + ], + }, + incidentId: INCIDENT_DATA_ID, +}; + +apiInstance + .updateIncidentAttachments(params) + .then((data: v2.IncidentAttachmentUpdateResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/v2/given.json b/features/v2/given.json index 0a3a34949a36..ae5daeae6999 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -79,6 +79,22 @@ "tag": "Incidents", "operationId": "CreateIncident" }, + { + "parameters": [ + { + "name": "incident_id", + "source": "incident.data.id" + }, + { + "name": "body", + "value": "{\n \"data\": [\n {\n \"attributes\": {\n \"attachment_type\": \"link\",\n \"attachment\": {\n \"documentUrl\": \"https://www.example.com/doc\",\n \"title\": \"Important Doc\"\n }\n },\n \"type\": \"incident_attachments\"\n }\n ]\n}" + } + ], + "step": "the \"incident\" has an \"incident_attachment\"", + "key": "incident_attachment", + "tag": "Incidents", + "operationId": "UpdateIncidentAttachments" + }, { "parameters": [ { diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index 0ff512cc1571..592f80801819 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -18,6 +18,17 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @team:DataDog/incident-app + Scenario: Create an incident attachment returns "OK" response + Given operation "UpdateIncidentAttachments" enabled + And there is a valid "incident" in the system + And new "UpdateIncidentAttachments" request + And request contains "incident_id" parameter from "incident.data.id" + And body with value {"data": [{"type": "incident_attachments", "attributes": {"attachment_type": "link", "attachment": {"documentUrl": "https://www.example.com/doc", "title": "{{unique}}"}}}]} + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + @generated @skip @team:DataDog/incident-app Scenario: Create an incident returns "Bad Request" response Given operation "CreateIncident" enabled @@ -44,6 +55,33 @@ Feature: Incidents When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/incident-app + Scenario: Create, update, and delete incident attachments returns "Bad Request" response + Given operation "UpdateIncidentAttachments" enabled + And new "UpdateIncidentAttachments" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": [{"attributes": {"attachment": {"documentUrl": "https://app.datadoghq.com/notebook/123", "title": "Postmortem IR-123"}, "attachment_type": "postmortem"}, "id": "00000000-abcd-0002-0000-000000000000", "type": "incident_attachments"}, {"attributes": {"attachment": {"documentUrl": "https://www.example.com/webstore-failure-runbook", "title": "Runbook for webstore service failures"}, "attachment_type": "link"}, "type": "incident_attachments"}, {"id": "00000000-abcd-0003-0000-000000000000", "type": "incident_attachments"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Create, update, and delete incident attachments returns "Not Found" response + Given operation "UpdateIncidentAttachments" enabled + And new "UpdateIncidentAttachments" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": [{"attributes": {"attachment": {"documentUrl": "https://app.datadoghq.com/notebook/123", "title": "Postmortem IR-123"}, "attachment_type": "postmortem"}, "id": "00000000-abcd-0002-0000-000000000000", "type": "incident_attachments"}, {"attributes": {"attachment": {"documentUrl": "https://www.example.com/webstore-failure-runbook", "title": "Runbook for webstore service failures"}, "attachment_type": "link"}, "type": "incident_attachments"}, {"id": "00000000-abcd-0003-0000-000000000000", "type": "incident_attachments"}]} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Create, update, and delete incident attachments returns "OK" response + Given operation "UpdateIncidentAttachments" enabled + And new "UpdateIncidentAttachments" request + And request contains "incident_id" parameter from "REPLACE.ME" + And body with value {"data": [{"attributes": {"attachment": {"documentUrl": "https://app.datadoghq.com/notebook/123", "title": "Postmortem IR-123"}, "attachment_type": "postmortem"}, "id": "00000000-abcd-0002-0000-000000000000", "type": "incident_attachments"}, {"attributes": {"attachment": {"documentUrl": "https://www.example.com/webstore-failure-runbook", "title": "Runbook for webstore service failures"}, "attachment_type": "link"}, "type": "incident_attachments"}, {"id": "00000000-abcd-0003-0000-000000000000", "type": "incident_attachments"}]} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Delete an existing incident returns "Bad Request" response Given operation "DeleteIncident" enabled @@ -69,6 +107,30 @@ Feature: Incidents When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/incident-app + Scenario: Get a list of attachments returns "Bad Request" response + Given operation "ListIncidentAttachments" enabled + And new "ListIncidentAttachments" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Get a list of attachments returns "Not Found" response + Given operation "ListIncidentAttachments" enabled + And new "ListIncidentAttachments" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Get a list of attachments returns "OK" response + Given operation "ListIncidentAttachments" enabled + And new "ListIncidentAttachments" request + And request contains "incident_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app Scenario: Get a list of incidents returns "Bad Request" response Given operation "ListIncidents" enabled @@ -100,6 +162,17 @@ Feature: Incidents Then the response status is 200 OK And the response has 3 items + @team:DataDog/incident-app + Scenario: Get incident attachments returns "OK" response + Given operation "ListIncidentAttachments" enabled + And there is a valid "incident" in the system + And the "incident" has an "incident_attachment" + And new "ListIncidentAttachments" request + And request contains "incident_id" parameter from "incident.data.id" + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + @generated @skip @team:DataDog/incident-app Scenario: Get the details of an incident returns "Bad Request" response Given operation "GetIncident" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 1e42d9388dd8..80a6729cdffb 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -219,6 +219,18 @@ "type": "idempotent" } }, + "ListIncidentAttachments": { + "tag": "Incidents", + "undo": { + "type": "safe" + } + }, + "UpdateIncidentAttachments": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ListOpsgenieServices": { "tag": "Opsgenie Integration", "undo": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index 80b76f89108b..9e66a03d70ab 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -119,8 +119,10 @@ export function createConfiguration( "v2.createIncident": false, "v2.deleteIncident": false, "v2.getIncident": false, + "v2.listIncidentAttachments": false, "v2.listIncidents": false, "v2.updateIncident": false, + "v2.updateIncidentAttachments": false, "v2.createIncidentService": false, "v2.deleteIncidentService": false, "v2.getIncidentService": false, diff --git a/packages/datadog-api-client-v2/apis/IncidentsApi.ts b/packages/datadog-api-client-v2/apis/IncidentsApi.ts index f1ee421011ab..a498b0722614 100644 --- a/packages/datadog-api-client-v2/apis/IncidentsApi.ts +++ b/packages/datadog-api-client-v2/apis/IncidentsApi.ts @@ -18,6 +18,11 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; import { APIErrorResponse } from "../models/APIErrorResponse"; +import { IncidentAttachmentAttachmentType } from "../models/IncidentAttachmentAttachmentType"; +import { IncidentAttachmentRelatedObject } from "../models/IncidentAttachmentRelatedObject"; +import { IncidentAttachmentsResponse } from "../models/IncidentAttachmentsResponse"; +import { IncidentAttachmentUpdateRequest } from "../models/IncidentAttachmentUpdateRequest"; +import { IncidentAttachmentUpdateResponse } from "../models/IncidentAttachmentUpdateResponse"; import { IncidentCreateRequest } from "../models/IncidentCreateRequest"; import { IncidentRelatedObject } from "../models/IncidentRelatedObject"; import { IncidentResponse } from "../models/IncidentResponse"; @@ -169,6 +174,74 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async listIncidentAttachments( + incidentId: string, + include?: Array, + filterAttachmentType?: Array, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listIncidentAttachments'"); + if (!_config.unstableOperations["v2.listIncidentAttachments"]) { + throw new Error( + "Unstable operation 'listIncidentAttachments' is disabled" + ); + } + + // verify required parameter 'incidentId' is not null or undefined + if (incidentId === null || incidentId === undefined) { + throw new RequiredError( + "Required parameter incidentId was null or undefined when calling listIncidentAttachments." + ); + } + + // Path Params + const localVarPath = "/api/v2/incidents/{incident_id}/attachments".replace( + "{" + "incident_id" + "}", + encodeURIComponent(String(incidentId)) + ); + + // Make Request Context + const requestContext = getServer( + _config, + "v2.IncidentsApi.listIncidentAttachments" + ).makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (include !== undefined) { + requestContext.setQueryParam( + "include", + ObjectSerializer.serialize( + include, + "Array", + "" + ) + ); + } + if (filterAttachmentType !== undefined) { + requestContext.setQueryParam( + "filter[attachment_type]", + ObjectSerializer.serialize( + filterAttachmentType, + "Array", + "" + ) + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "AuthZ", + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async listIncidents( include?: Array, pageSize?: number, @@ -292,6 +365,81 @@ export class IncidentsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + + public async updateIncidentAttachments( + incidentId: string, + body: IncidentAttachmentUpdateRequest, + include?: Array, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'updateIncidentAttachments'"); + if (!_config.unstableOperations["v2.updateIncidentAttachments"]) { + throw new Error( + "Unstable operation 'updateIncidentAttachments' is disabled" + ); + } + + // verify required parameter 'incidentId' is not null or undefined + if (incidentId === null || incidentId === undefined) { + throw new RequiredError( + "Required parameter incidentId was null or undefined when calling updateIncidentAttachments." + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError( + "Required parameter body was null or undefined when calling updateIncidentAttachments." + ); + } + + // Path Params + const localVarPath = "/api/v2/incidents/{incident_id}/attachments".replace( + "{" + "incident_id" + "}", + encodeURIComponent(String(incidentId)) + ); + + // Make Request Context + const requestContext = getServer( + _config, + "v2.IncidentsApi.updateIncidentAttachments" + ).makeRequestContext(localVarPath, HttpMethod.PATCH); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (include !== undefined) { + requestContext.setQueryParam( + "include", + ObjectSerializer.serialize( + include, + "Array", + "" + ) + ); + } + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "IncidentAttachmentUpdateRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } } export class IncidentsApiResponseProcessor { @@ -478,6 +626,69 @@ export class IncidentsApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listIncidentAttachments + * @throws ApiException if the response code was not in [200, 299] + */ + public async listIncidentAttachments( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode == 200) { + const body: IncidentAttachmentsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentAttachmentsResponse" + ) as IncidentAttachmentsResponse; + return body; + } + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: IncidentAttachmentsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentAttachmentsResponse", + "" + ) as IncidentAttachmentsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -603,6 +814,71 @@ export class IncidentsApiResponseProcessor { 'Unknown API Status Code!\nBody: "' + body + '"' ); } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to updateIncidentAttachments + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateIncidentAttachments( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode == 200) { + const body: IncidentAttachmentUpdateResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentAttachmentUpdateResponse" + ) as IncidentAttachmentUpdateResponse; + return body; + } + if ( + response.httpStatusCode == 400 || + response.httpStatusCode == 401 || + response.httpStatusCode == 403 || + response.httpStatusCode == 404 || + response.httpStatusCode == 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + try { + const body: APIErrorResponse = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + throw new ApiException(response.httpStatusCode, body); + } catch (error) { + logger.info(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: IncidentAttachmentUpdateResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "IncidentAttachmentUpdateResponse", + "" + ) as IncidentAttachmentUpdateResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } } export interface IncidentsApiCreateIncidentRequest { @@ -634,6 +910,24 @@ export interface IncidentsApiGetIncidentRequest { include?: Array; } +export interface IncidentsApiListIncidentAttachmentsRequest { + /** + * The UUID of the incident. + * @type string + */ + incidentId: string; + /** + * Specifies which types of related objects are included in the response. + * @type Array + */ + include?: Array; + /** + * Specifies which types of attachments are included in the response. + * @type Array + */ + filterAttachmentType?: Array; +} + export interface IncidentsApiListIncidentsRequest { /** * Specifies which types of related objects should be included in the response. @@ -670,6 +964,24 @@ export interface IncidentsApiUpdateIncidentRequest { include?: Array; } +export interface IncidentsApiUpdateIncidentAttachmentsRequest { + /** + * The UUID of the incident. + * @type string + */ + incidentId: string; + /** + * Incident Attachment Payload. + * @type IncidentAttachmentUpdateRequest + */ + body: IncidentAttachmentUpdateRequest; + /** + * Specifies which types of related objects are included in the response. + * @type Array + */ + include?: Array; +} + export class IncidentsApi { private requestFactory: IncidentsApiRequestFactory; private responseProcessor: IncidentsApiResponseProcessor; @@ -751,6 +1063,31 @@ export class IncidentsApi { }); } + /** + * Get all attachments for a given incident. + * @param param The request object + */ + public listIncidentAttachments( + param: IncidentsApiListIncidentAttachmentsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listIncidentAttachments( + param.incidentId, + param.include, + param.filterAttachmentType, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listIncidentAttachments( + responseContext + ); + }); + }); + } + /** * Get all incidents for the user's organization. * @param param The request object @@ -841,4 +1178,29 @@ export class IncidentsApi { }); }); } + + /** + * The bulk update endpoint for creating, updating, and deleting attachments for a given incident. + * @param param The request object + */ + public updateIncidentAttachments( + param: IncidentsApiUpdateIncidentAttachmentsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.updateIncidentAttachments( + param.incidentId, + param.body, + param.include, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateIncidentAttachments( + responseContext + ); + }); + }); + } } diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 50d74bbe0e91..f89d635663d6 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -57,8 +57,10 @@ export { IncidentsApiCreateIncidentRequest, IncidentsApiDeleteIncidentRequest, IncidentsApiGetIncidentRequest, + IncidentsApiListIncidentAttachmentsRequest, IncidentsApiListIncidentsRequest, IncidentsApiUpdateIncidentRequest, + IncidentsApiUpdateIncidentAttachmentsRequest, IncidentsApi, } from "./apis/IncidentsApi"; @@ -339,6 +341,24 @@ export { HTTPLogError } from "./models/HTTPLogError"; export { HTTPLogErrors } from "./models/HTTPLogErrors"; export { HTTPLogItem } from "./models/HTTPLogItem"; export { IdPMetadataFormData } from "./models/IdPMetadataFormData"; +export { IncidentAttachmentAttachmentType } from "./models/IncidentAttachmentAttachmentType"; +export { IncidentAttachmentAttributes } from "./models/IncidentAttachmentAttributes"; +export { IncidentAttachmentData } from "./models/IncidentAttachmentData"; +export { IncidentAttachmentLinkAttachmentType } from "./models/IncidentAttachmentLinkAttachmentType"; +export { IncidentAttachmentLinkAttributes } from "./models/IncidentAttachmentLinkAttributes"; +export { IncidentAttachmentLinkAttributesAttachmentObject } from "./models/IncidentAttachmentLinkAttributesAttachmentObject"; +export { IncidentAttachmentPostmortemAttachmentType } from "./models/IncidentAttachmentPostmortemAttachmentType"; +export { IncidentAttachmentPostmortemAttributes } from "./models/IncidentAttachmentPostmortemAttributes"; +export { IncidentAttachmentRelatedObject } from "./models/IncidentAttachmentRelatedObject"; +export { IncidentAttachmentRelationships } from "./models/IncidentAttachmentRelationships"; +export { IncidentAttachmentsPostmortemAttributesAttachmentObject } from "./models/IncidentAttachmentsPostmortemAttributesAttachmentObject"; +export { IncidentAttachmentsResponse } from "./models/IncidentAttachmentsResponse"; +export { IncidentAttachmentsResponseIncludedItem } from "./models/IncidentAttachmentsResponseIncludedItem"; +export { IncidentAttachmentType } from "./models/IncidentAttachmentType"; +export { IncidentAttachmentUpdateAttributes } from "./models/IncidentAttachmentUpdateAttributes"; +export { IncidentAttachmentUpdateData } from "./models/IncidentAttachmentUpdateData"; +export { IncidentAttachmentUpdateRequest } from "./models/IncidentAttachmentUpdateRequest"; +export { IncidentAttachmentUpdateResponse } from "./models/IncidentAttachmentUpdateResponse"; export { IncidentCreateAttributes } from "./models/IncidentCreateAttributes"; export { IncidentCreateData } from "./models/IncidentCreateData"; export { IncidentCreateRelationships } from "./models/IncidentCreateRelationships"; @@ -561,6 +581,8 @@ export { ProcessSummary } from "./models/ProcessSummary"; export { ProcessSummaryAttributes } from "./models/ProcessSummaryAttributes"; export { ProcessSummaryType } from "./models/ProcessSummaryType"; export { QuerySortOrder } from "./models/QuerySortOrder"; +export { RelationshipToIncidentAttachment } from "./models/RelationshipToIncidentAttachment"; +export { RelationshipToIncidentAttachmentData } from "./models/RelationshipToIncidentAttachmentData"; export { RelationshipToIncidentIntegrationMetadataData } from "./models/RelationshipToIncidentIntegrationMetadataData"; export { RelationshipToIncidentIntegrationMetadatas } from "./models/RelationshipToIncidentIntegrationMetadatas"; export { RelationshipToIncidentPostmortem } from "./models/RelationshipToIncidentPostmortem"; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentAttachmentType.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentAttachmentType.ts new file mode 100644 index 000000000000..eb20deb7735b --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentAttachmentType.ts @@ -0,0 +1,9 @@ +/** + * 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. + */ + +export type IncidentAttachmentAttachmentType = typeof LINK | typeof POSTMORTEM; +export const LINK = "link"; +export const POSTMORTEM = "postmortem"; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentAttributes.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentAttributes.ts new file mode 100644 index 000000000000..8895c620e2fc --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentAttributes.ts @@ -0,0 +1,18 @@ +/** + * 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. + */ +import { IncidentAttachmentLinkAttributes } from "./IncidentAttachmentLinkAttributes"; +import { IncidentAttachmentPostmortemAttributes } from "./IncidentAttachmentPostmortemAttributes"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The attributes object for an attachment. + */ + +export type IncidentAttachmentAttributes = + | IncidentAttachmentPostmortemAttributes + | IncidentAttachmentLinkAttributes + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentData.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentData.ts new file mode 100644 index 000000000000..c560d1648ca9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentData.ts @@ -0,0 +1,72 @@ +/** + * 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. + */ +import { IncidentAttachmentAttributes } from "./IncidentAttachmentAttributes"; +import { IncidentAttachmentRelationships } from "./IncidentAttachmentRelationships"; +import { IncidentAttachmentType } from "./IncidentAttachmentType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A single incident attachment. + */ +export class IncidentAttachmentData { + /** + * The attributes object for an attachment. + */ + "attributes": IncidentAttachmentAttributes; + /** + * A unique identifier that represents the incident attachment. + */ + "id": string; + /** + * The incident attachment's relationships. + */ + "relationships": IncidentAttachmentRelationships; + /** + * The incident attachment resource type. + */ + "type": IncidentAttachmentType; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "IncidentAttachmentAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "IncidentAttachmentRelationships", + required: true, + }, + type: { + baseName: "type", + type: "IncidentAttachmentType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentAttachmentData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttachmentType.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttachmentType.ts new file mode 100644 index 000000000000..72deb0861c26 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttachmentType.ts @@ -0,0 +1,8 @@ +/** + * 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. + */ + +export type IncidentAttachmentLinkAttachmentType = typeof LINK; +export const LINK = "link"; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributes.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributes.ts new file mode 100644 index 000000000000..0ff3be09a4cc --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributes.ts @@ -0,0 +1,53 @@ +/** + * 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. + */ +import { IncidentAttachmentLinkAttachmentType } from "./IncidentAttachmentLinkAttachmentType"; +import { IncidentAttachmentLinkAttributesAttachmentObject } from "./IncidentAttachmentLinkAttributesAttachmentObject"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The attributes object for a link attachment. + */ +export class IncidentAttachmentLinkAttributes { + /** + * The link attachment. + */ + "attachment": IncidentAttachmentLinkAttributesAttachmentObject; + /** + * The type of link attachment attributes. + */ + "attachmentType": IncidentAttachmentLinkAttachmentType; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attachment: { + baseName: "attachment", + type: "IncidentAttachmentLinkAttributesAttachmentObject", + required: true, + }, + attachmentType: { + baseName: "attachment_type", + type: "IncidentAttachmentLinkAttachmentType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentAttachmentLinkAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributesAttachmentObject.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributesAttachmentObject.ts new file mode 100644 index 000000000000..a9e9ee7e8630 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentLinkAttributesAttachmentObject.ts @@ -0,0 +1,51 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The link attachment. + */ +export class IncidentAttachmentLinkAttributesAttachmentObject { + /** + * The URL of this link attachment. + */ + "documentUrl": string; + /** + * The title of this link attachment. + */ + "title": string; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + documentUrl: { + baseName: "documentUrl", + type: "string", + required: true, + }, + title: { + baseName: "title", + type: "string", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentAttachmentLinkAttributesAttachmentObject.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttachmentType.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttachmentType.ts new file mode 100644 index 000000000000..abf80cf65283 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttachmentType.ts @@ -0,0 +1,8 @@ +/** + * 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. + */ + +export type IncidentAttachmentPostmortemAttachmentType = typeof POSTMORTEM; +export const POSTMORTEM = "postmortem"; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttributes.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttributes.ts new file mode 100644 index 000000000000..45f30550cad4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentPostmortemAttributes.ts @@ -0,0 +1,53 @@ +/** + * 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. + */ +import { IncidentAttachmentPostmortemAttachmentType } from "./IncidentAttachmentPostmortemAttachmentType"; +import { IncidentAttachmentsPostmortemAttributesAttachmentObject } from "./IncidentAttachmentsPostmortemAttributesAttachmentObject"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The attributes object for a postmortem attachment. + */ +export class IncidentAttachmentPostmortemAttributes { + /** + * The postmortem attachment. + */ + "attachment": IncidentAttachmentsPostmortemAttributesAttachmentObject; + /** + * The type of postmortem attachment attributes. + */ + "attachmentType": IncidentAttachmentPostmortemAttachmentType; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attachment: { + baseName: "attachment", + type: "IncidentAttachmentsPostmortemAttributesAttachmentObject", + required: true, + }, + attachmentType: { + baseName: "attachment_type", + type: "IncidentAttachmentPostmortemAttachmentType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentAttachmentPostmortemAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentRelatedObject.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentRelatedObject.ts new file mode 100644 index 000000000000..dd701c6fa2d4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentRelatedObject.ts @@ -0,0 +1,8 @@ +/** + * 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. + */ + +export type IncidentAttachmentRelatedObject = typeof USERS; +export const USERS = "users"; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentRelationships.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentRelationships.ts new file mode 100644 index 000000000000..c64b458d9ed5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentRelationships.ts @@ -0,0 +1,42 @@ +/** + * 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. + */ +import { RelationshipToUser } from "./RelationshipToUser"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The incident attachment's relationships. + */ +export class IncidentAttachmentRelationships { + /** + * Relationship to user. + */ + "lastModifiedByUser"?: RelationshipToUser; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + lastModifiedByUser: { + baseName: "last_modified_by_user", + type: "RelationshipToUser", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentAttachmentRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentType.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentType.ts new file mode 100644 index 000000000000..93b3400b9c7d --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentType.ts @@ -0,0 +1,8 @@ +/** + * 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. + */ + +export type IncidentAttachmentType = typeof INCIDENT_ATTACHMENTS; +export const INCIDENT_ATTACHMENTS = "incident_attachments"; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateAttributes.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateAttributes.ts new file mode 100644 index 000000000000..1792ea143f52 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateAttributes.ts @@ -0,0 +1,18 @@ +/** + * 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. + */ +import { IncidentAttachmentLinkAttributes } from "./IncidentAttachmentLinkAttributes"; +import { IncidentAttachmentPostmortemAttributes } from "./IncidentAttachmentPostmortemAttributes"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Incident attachment attributes. + */ + +export type IncidentAttachmentUpdateAttributes = + | IncidentAttachmentPostmortemAttributes + | IncidentAttachmentLinkAttributes + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateData.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateData.ts new file mode 100644 index 000000000000..460a113866de --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateData.ts @@ -0,0 +1,60 @@ +/** + * 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. + */ +import { IncidentAttachmentType } from "./IncidentAttachmentType"; +import { IncidentAttachmentUpdateAttributes } from "./IncidentAttachmentUpdateAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A single incident attachment. + */ +export class IncidentAttachmentUpdateData { + /** + * Incident attachment attributes. + */ + "attributes"?: IncidentAttachmentUpdateAttributes; + /** + * A unique identifier that represents the incident attachment. + */ + "id"?: string; + /** + * The incident attachment resource type. + */ + "type": IncidentAttachmentType; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "IncidentAttachmentUpdateAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "IncidentAttachmentType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentAttachmentUpdateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateRequest.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateRequest.ts new file mode 100644 index 000000000000..77a541326e15 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateRequest.ts @@ -0,0 +1,46 @@ +/** + * 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. + */ +import { IncidentAttachmentUpdateData } from "./IncidentAttachmentUpdateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The update request for an incident's attachments. + */ +export class IncidentAttachmentUpdateRequest { + /** + * An array of incident attachments. An attachment object without an "id" key indicates that you want to + * create that attachment. An attachment object without an "attributes" key indicates that you want to + * delete that attachment. An attachment object with both the "id" key and a populated "attributes" object + * indicates that you want to update that attachment. + */ + "data": Array; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentAttachmentUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateResponse.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateResponse.ts new file mode 100644 index 000000000000..f1e01467ba9b --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentUpdateResponse.ts @@ -0,0 +1,53 @@ +/** + * 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. + */ +import { IncidentAttachmentData } from "./IncidentAttachmentData"; +import { IncidentAttachmentsResponseIncludedItem } from "./IncidentAttachmentsResponseIncludedItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The response object containing the created or updated incident attachments. + */ +export class IncidentAttachmentUpdateResponse { + /** + * An array of incident attachments. Only the attachments that were created or updated by the request are + * returned. + */ + "data": Array; + /** + * Included related resources that the user requested. + */ + "included"?: Array; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + included: { + baseName: "included", + type: "Array", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentAttachmentUpdateResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentsPostmortemAttributesAttachmentObject.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentsPostmortemAttributesAttachmentObject.ts new file mode 100644 index 000000000000..e7f59ff78435 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentsPostmortemAttributesAttachmentObject.ts @@ -0,0 +1,51 @@ +/** + * 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. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The postmortem attachment. + */ +export class IncidentAttachmentsPostmortemAttributesAttachmentObject { + /** + * The URL of this notebook attachment. + */ + "documentUrl": string; + /** + * The title of this postmortem attachment. + */ + "title": string; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + documentUrl: { + baseName: "documentUrl", + type: "string", + required: true, + }, + title: { + baseName: "title", + type: "string", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentAttachmentsPostmortemAttributesAttachmentObject.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentsResponse.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentsResponse.ts new file mode 100644 index 000000000000..a42e74eaf490 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentsResponse.ts @@ -0,0 +1,52 @@ +/** + * 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. + */ +import { IncidentAttachmentData } from "./IncidentAttachmentData"; +import { IncidentAttachmentsResponseIncludedItem } from "./IncidentAttachmentsResponseIncludedItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The response object containing an incident's attachments. + */ +export class IncidentAttachmentsResponse { + /** + * An array of incident attachments. + */ + "data": Array; + /** + * Included related resources that the user requested. + */ + "included"?: Array; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + included: { + baseName: "included", + type: "Array", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return IncidentAttachmentsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/IncidentAttachmentsResponseIncludedItem.ts b/packages/datadog-api-client-v2/models/IncidentAttachmentsResponseIncludedItem.ts new file mode 100644 index 000000000000..a6969b091126 --- /dev/null +++ b/packages/datadog-api-client-v2/models/IncidentAttachmentsResponseIncludedItem.ts @@ -0,0 +1,14 @@ +/** + * 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. + */ +import { User } from "./User"; + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * An object related to an attachment that is included in the response. + */ + +export type IncidentAttachmentsResponseIncludedItem = User | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/IncidentRelatedObject.ts b/packages/datadog-api-client-v2/models/IncidentRelatedObject.ts index 96cfdf42b68c..9fd2aded8740 100644 --- a/packages/datadog-api-client-v2/models/IncidentRelatedObject.ts +++ b/packages/datadog-api-client-v2/models/IncidentRelatedObject.ts @@ -4,5 +4,6 @@ * Copyright 2020-Present Datadog, Inc. */ -export type IncidentRelatedObject = typeof USERS; +export type IncidentRelatedObject = typeof USERS | typeof ATTACHMENTS; export const USERS = "users"; +export const ATTACHMENTS = "attachments"; diff --git a/packages/datadog-api-client-v2/models/IncidentResponseAttributes.ts b/packages/datadog-api-client-v2/models/IncidentResponseAttributes.ts index abe46608f01d..01c16584ffd3 100644 --- a/packages/datadog-api-client-v2/models/IncidentResponseAttributes.ts +++ b/packages/datadog-api-client-v2/models/IncidentResponseAttributes.ts @@ -53,10 +53,6 @@ export class IncidentResponseAttributes { * Notification handles that will be notified of the incident during update. */ "notificationHandles"?: Array; - /** - * The UUID of the postmortem object attached to the incident. - */ - "postmortemId"?: string; /** * The monotonically increasing integer ID for the incident. */ @@ -142,10 +138,6 @@ export class IncidentResponseAttributes { baseName: "notification_handles", type: "Array", }, - postmortemId: { - baseName: "postmortem_id", - type: "string", - }, publicId: { baseName: "public_id", type: "number", diff --git a/packages/datadog-api-client-v2/models/IncidentResponseIncludedItem.ts b/packages/datadog-api-client-v2/models/IncidentResponseIncludedItem.ts index 8fd7ceff177d..846c33378174 100644 --- a/packages/datadog-api-client-v2/models/IncidentResponseIncludedItem.ts +++ b/packages/datadog-api-client-v2/models/IncidentResponseIncludedItem.ts @@ -3,6 +3,7 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2020-Present Datadog, Inc. */ +import { IncidentAttachmentData } from "./IncidentAttachmentData"; import { User } from "./User"; import { UnparsedObject } from "../../datadog-api-client-common/util"; @@ -11,4 +12,7 @@ import { UnparsedObject } from "../../datadog-api-client-common/util"; * An object related to an incident that is included in the response. */ -export type IncidentResponseIncludedItem = User | UnparsedObject; +export type IncidentResponseIncludedItem = + | User + | IncidentAttachmentData + | UnparsedObject; diff --git a/packages/datadog-api-client-v2/models/IncidentResponseRelationships.ts b/packages/datadog-api-client-v2/models/IncidentResponseRelationships.ts index 952c7cb7374a..33d2fb261835 100644 --- a/packages/datadog-api-client-v2/models/IncidentResponseRelationships.ts +++ b/packages/datadog-api-client-v2/models/IncidentResponseRelationships.ts @@ -4,8 +4,8 @@ * Copyright 2020-Present Datadog, Inc. */ import { NullableRelationshipToUser } from "./NullableRelationshipToUser"; +import { RelationshipToIncidentAttachment } from "./RelationshipToIncidentAttachment"; import { RelationshipToIncidentIntegrationMetadatas } from "./RelationshipToIncidentIntegrationMetadatas"; -import { RelationshipToIncidentPostmortem } from "./RelationshipToIncidentPostmortem"; import { RelationshipToUser } from "./RelationshipToUser"; import { AttributeTypeMap } from "../../datadog-api-client-common/util"; @@ -14,6 +14,10 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util"; * The incident's relationships from a response. */ export class IncidentResponseRelationships { + /** + * A relationship reference for attachments. + */ + "attachments"?: RelationshipToIncidentAttachment; /** * Relationship to user. */ @@ -30,10 +34,6 @@ export class IncidentResponseRelationships { * Relationship to user. */ "lastModifiedByUser"?: RelationshipToUser; - /** - * A relationship reference for postmortems. - */ - "postmortem"?: RelationshipToIncidentPostmortem; /** * @ignore @@ -44,6 +44,10 @@ export class IncidentResponseRelationships { * @ignore */ static readonly attributeTypeMap: AttributeTypeMap = { + attachments: { + baseName: "attachments", + type: "RelationshipToIncidentAttachment", + }, commanderUser: { baseName: "commander_user", type: "NullableRelationshipToUser", @@ -60,10 +64,6 @@ export class IncidentResponseRelationships { baseName: "last_modified_by_user", type: "RelationshipToUser", }, - postmortem: { - baseName: "postmortem", - type: "RelationshipToIncidentPostmortem", - }, }; /** diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 8022bee5a37b..167a5f660b88 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -94,6 +94,16 @@ import { HourlyUsageMetadata } from "./HourlyUsageMetadata"; import { HourlyUsagePagination } from "./HourlyUsagePagination"; import { HourlyUsageResponse } from "./HourlyUsageResponse"; import { IdPMetadataFormData } from "./IdPMetadataFormData"; +import { IncidentAttachmentData } from "./IncidentAttachmentData"; +import { IncidentAttachmentLinkAttributes } from "./IncidentAttachmentLinkAttributes"; +import { IncidentAttachmentLinkAttributesAttachmentObject } from "./IncidentAttachmentLinkAttributesAttachmentObject"; +import { IncidentAttachmentPostmortemAttributes } from "./IncidentAttachmentPostmortemAttributes"; +import { IncidentAttachmentRelationships } from "./IncidentAttachmentRelationships"; +import { IncidentAttachmentUpdateData } from "./IncidentAttachmentUpdateData"; +import { IncidentAttachmentUpdateRequest } from "./IncidentAttachmentUpdateRequest"; +import { IncidentAttachmentUpdateResponse } from "./IncidentAttachmentUpdateResponse"; +import { IncidentAttachmentsPostmortemAttributesAttachmentObject } from "./IncidentAttachmentsPostmortemAttributesAttachmentObject"; +import { IncidentAttachmentsResponse } from "./IncidentAttachmentsResponse"; import { IncidentCreateAttributes } from "./IncidentCreateAttributes"; import { IncidentCreateData } from "./IncidentCreateData"; import { IncidentCreateRelationships } from "./IncidentCreateRelationships"; @@ -291,6 +301,8 @@ import { RUMResponseMetadata } from "./RUMResponseMetadata"; import { RUMResponsePage } from "./RUMResponsePage"; import { RUMSearchEventsRequest } from "./RUMSearchEventsRequest"; import { RUMWarning } from "./RUMWarning"; +import { RelationshipToIncidentAttachment } from "./RelationshipToIncidentAttachment"; +import { RelationshipToIncidentAttachmentData } from "./RelationshipToIncidentAttachmentData"; import { RelationshipToIncidentIntegrationMetadataData } from "./RelationshipToIncidentIntegrationMetadataData"; import { RelationshipToIncidentIntegrationMetadatas } from "./RelationshipToIncidentIntegrationMetadatas"; import { RelationshipToIncidentPostmortem } from "./RelationshipToIncidentPostmortem"; @@ -498,6 +510,11 @@ const enumsMap: { [key: string]: any[] } = { "observability_pipelines_bytes_processed", "lambda_traced_invocations_count", ], + IncidentAttachmentAttachmentType: ["link", "postmortem"], + IncidentAttachmentLinkAttachmentType: ["link"], + IncidentAttachmentPostmortemAttachmentType: ["postmortem"], + IncidentAttachmentRelatedObject: ["users"], + IncidentAttachmentType: ["incident_attachments"], IncidentFieldAttributesSingleValueType: ["dropdown", "textbox"], IncidentFieldAttributesValueType: [ "multiselect", @@ -507,7 +524,7 @@ const enumsMap: { [key: string]: any[] } = { ], IncidentIntegrationMetadataType: ["incident_integrations"], IncidentPostmortemType: ["incident_postmortems"], - IncidentRelatedObject: ["users"], + IncidentRelatedObject: ["users", "attachments"], IncidentServiceType: ["services"], IncidentTeamType: ["teams"], IncidentTimelineCellMarkdownContentType: ["markdown"], @@ -759,6 +776,19 @@ const typeMap: { [index: string]: any } = { HourlyUsagePagination: HourlyUsagePagination, HourlyUsageResponse: HourlyUsageResponse, IdPMetadataFormData: IdPMetadataFormData, + IncidentAttachmentData: IncidentAttachmentData, + IncidentAttachmentLinkAttributes: IncidentAttachmentLinkAttributes, + IncidentAttachmentLinkAttributesAttachmentObject: + IncidentAttachmentLinkAttributesAttachmentObject, + IncidentAttachmentPostmortemAttributes: + IncidentAttachmentPostmortemAttributes, + IncidentAttachmentRelationships: IncidentAttachmentRelationships, + IncidentAttachmentUpdateData: IncidentAttachmentUpdateData, + IncidentAttachmentUpdateRequest: IncidentAttachmentUpdateRequest, + IncidentAttachmentUpdateResponse: IncidentAttachmentUpdateResponse, + IncidentAttachmentsPostmortemAttributesAttachmentObject: + IncidentAttachmentsPostmortemAttributesAttachmentObject, + IncidentAttachmentsResponse: IncidentAttachmentsResponse, IncidentCreateAttributes: IncidentCreateAttributes, IncidentCreateData: IncidentCreateData, IncidentCreateRelationships: IncidentCreateRelationships, @@ -964,6 +994,8 @@ const typeMap: { [index: string]: any } = { RUMResponsePage: RUMResponsePage, RUMSearchEventsRequest: RUMSearchEventsRequest, RUMWarning: RUMWarning, + RelationshipToIncidentAttachment: RelationshipToIncidentAttachment, + RelationshipToIncidentAttachmentData: RelationshipToIncidentAttachmentData, RelationshipToIncidentIntegrationMetadataData: RelationshipToIncidentIntegrationMetadataData, RelationshipToIncidentIntegrationMetadatas: @@ -1112,11 +1144,20 @@ const oneOfMap: { [index: string]: string[] } = { APIKeyResponseIncludedItem: ["User"], ApplicationKeyResponseIncludedItem: ["User", "Role"], AuthNMappingIncluded: ["SAMLAssertionAttribute", "Role"], + IncidentAttachmentAttributes: [ + "IncidentAttachmentPostmortemAttributes", + "IncidentAttachmentLinkAttributes", + ], + IncidentAttachmentUpdateAttributes: [ + "IncidentAttachmentPostmortemAttributes", + "IncidentAttachmentLinkAttributes", + ], + IncidentAttachmentsResponseIncludedItem: ["User"], IncidentFieldAttributes: [ "IncidentFieldAttributesSingleValue", "IncidentFieldAttributesMultipleValue", ], - IncidentResponseIncludedItem: ["User"], + IncidentResponseIncludedItem: ["User", "IncidentAttachmentData"], IncidentServiceIncludedItems: ["User"], IncidentTeamIncludedItems: ["User"], IncidentTimelineCellCreateAttributes: [ diff --git a/packages/datadog-api-client-v2/models/RelationshipToIncidentAttachment.ts b/packages/datadog-api-client-v2/models/RelationshipToIncidentAttachment.ts new file mode 100644 index 000000000000..a5e4429863bd --- /dev/null +++ b/packages/datadog-api-client-v2/models/RelationshipToIncidentAttachment.ts @@ -0,0 +1,43 @@ +/** + * 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. + */ +import { RelationshipToIncidentAttachmentData } from "./RelationshipToIncidentAttachmentData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A relationship reference for attachments. + */ +export class RelationshipToIncidentAttachment { + /** + * An array of incident attachments. + */ + "data": Array; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RelationshipToIncidentAttachment.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/RelationshipToIncidentAttachmentData.ts b/packages/datadog-api-client-v2/models/RelationshipToIncidentAttachmentData.ts new file mode 100644 index 000000000000..2665906ce847 --- /dev/null +++ b/packages/datadog-api-client-v2/models/RelationshipToIncidentAttachmentData.ts @@ -0,0 +1,52 @@ +/** + * 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. + */ +import { IncidentAttachmentType } from "./IncidentAttachmentType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The attachment relationship data. + */ +export class RelationshipToIncidentAttachmentData { + /** + * A unique identifier that represents the attachment. + */ + "id": string; + /** + * The incident attachment resource type. + */ + "type": IncidentAttachmentType; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "IncidentAttachmentType", + required: true, + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return RelationshipToIncidentAttachmentData.attributeTypeMap; + } + + public constructor() {} +} From 86fd2c77ba25df1ec12abec4c4aafd9e92b8835c Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 09:11:18 +0200 Subject: [PATCH 30/30] Release 1.4.0 (#864) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump version to 1.4.0 * Update CHANGELOG * Update CHANGELOG.md Co-authored-by: ci.datadog-api-spec Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Co-authored-by: Thomas Hervé --- CHANGELOG.md | 26 ++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eba191787235..a9befb66c736 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,31 @@ # CHANGELOG +## 1.4.0 / 2022-10-03 + +### Fixed +* Handle errors in deserialization errors by @therve in https://github.com/DataDog/datadog-api-client-typescript/pull/836 +* Refactor RuleQuery models by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/854 +* Fix SearchSLO response structure by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/856 +* Fix debug output by @therve in https://github.com/DataDog/datadog-api-client-typescript/pull/857 +### Added +* Add ListActiveConfigurations endpoint and add new filter[queried] param to list tag configurations endpoint by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/785 +* Add doesNotExist to synthetics operator enum by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/825 +* Add TopologyMapWidget to dashboard schema by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/828 +* Add Overall Status support to SLO Search API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/830 +* Add APM Fargate to Usage Metering API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/824 +* Add support for template variable multiselect in dashboards by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/835 +* Add storage option to widget query definitions by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/840 +* Add support for retrieving a security signal by ID by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/848 +* Add support for signal correlation API by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/841 +* Add support for SLO List widget by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/847 +* Add new historical_cost endpoint, and update estimate_cost by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/839 +* Add support for incident attachment APIs by @api-clients-generation-pipeline in https://github.com/DataDog/datadog-api-client-typescript/pull/852 + +## New Contributors +* @nkzou made their first contribution in https://github.com/DataDog/datadog-api-client-typescript/pull/822 + +**Full Changelog**: https://github.com/DataDog/datadog-api-client-typescript/compare/v1.3.0...v1.4.0 + ## 1.3.0 / 2022-08-31 ### Fixed diff --git a/package.json b/package.json index 0cb755af56df..02fb4d280cfa 100644 --- a/package.json +++ b/package.json @@ -111,5 +111,5 @@ "engines": { "node": ">=12.0.0" }, - "version": "1.3.1-beta.0" + "version": "1.4.0" }