From 3f7a29a3a860bc1866c7692d2a5ad1fc9ca31509 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 7 Apr 2022 18:08:46 +0000 Subject: [PATCH] Regenerate client from commit 5ed02dad of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 29 ++- .../frozen.json | 1 + .../recording.har | 194 ++++++++++++++++++ .../v1/synthetics/CreateGlobalVariable.ts | 2 +- .../v1/synthetics/CreatePrivateLocation.ts | 13 +- .../v1/synthetics/CreateSyntheticsAPITest.ts | 1 + examples/v1/synthetics/EditGlobalVariable.ts | 2 +- examples/v1/synthetics/UpdateBrowserTest.ts | 1 + .../v1/synthetics/UpdatePrivateLocation.ts | 3 + features/v1/synthetics.feature | 43 ++-- features/v1/undo.json | 2 +- .../.openapi-generator/FILES | 1 + packages/datadog-api-client-v1/index.ts | 1 + .../models/ObjectSerializer.ts | 2 + .../SyntheticsGlobalVariableAttributes.ts | 2 +- .../models/SyntheticsPrivateLocation.ts | 6 + .../SyntheticsPrivateLocationMetadata.ts | 46 +++++ .../models/SyntheticsTestOptions.ts | 8 + 19 files changed, 326 insertions(+), 39 deletions(-) create mode 100644 cassettes/v1/Synthetics_2658572017/Create-a-private-location-returns-OK-response_3848195822/frozen.json create mode 100644 cassettes/v1/Synthetics_2658572017/Create-a-private-location-returns-OK-response_3848195822/recording.har create mode 100644 packages/datadog-api-client-v1/models/SyntheticsPrivateLocationMetadata.ts diff --git a/.apigentools-info b/.apigentools-info index 75474716113..5fd14f079f0 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.2", - "regenerated": "2022-04-06 13:53:31.412683", - "spec_repo_commit": "0c154010" + "regenerated": "2022-04-07 18:07:20.321699", + "spec_repo_commit": "5ed02dad" }, "v2": { "apigentools_version": "1.6.2", - "regenerated": "2022-04-06 13:53:31.433241", - "spec_repo_commit": "0c154010" + "regenerated": "2022-04-07 18:07:20.339514", + "spec_repo_commit": "5ed02dad" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index bc700676483..68082bad220 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -11257,12 +11257,7 @@ components: description: Attributes of the global variable. properties: restricted_roles: - description: List of role identifiers that can be pulled from the Roles - API. - items: - description: UUID for a role. - type: string - type: array + $ref: '#/components/schemas/SyntheticsRestrictedRoles' type: object SyntheticsGlobalVariableParseTestOptions: description: Parser options to use for retrieving a Synthetics global variable @@ -11407,6 +11402,8 @@ components: description: Unique identifier of the private location. readOnly: true type: string + metadata: + $ref: '#/components/schemas/SyntheticsPrivateLocationMetadata' name: description: Name of the private location. example: New private location @@ -11450,6 +11447,12 @@ components: description: Public key for result encryption. type: string type: object + SyntheticsPrivateLocationMetadata: + description: Object containing metadata about the private location. + properties: + restricted_roles: + $ref: '#/components/schemas/SyntheticsRestrictedRoles' + type: object SyntheticsPrivateLocationSecrets: description: Secrets for the private location. Only present in the response when creating the private location. @@ -11480,6 +11483,16 @@ components: readOnly: true type: string type: object + SyntheticsRestrictedRoles: + description: A list of role identifiers that can be pulled from the Roles API, + for restricting read and write access. + example: + - xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + items: + description: UUID for a role. + example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + type: string + type: array SyntheticsSSLCertificate: description: Object describing the SSL certificate used for a Synthetic test. properties: @@ -11933,6 +11946,8 @@ components: noScreenshot: description: Prevents saving screenshots of the steps. type: boolean + restricted_roles: + $ref: '#/components/schemas/SyntheticsRestrictedRoles' retry: $ref: '#/components/schemas/SyntheticsTestOptionsRetry' tick_every: @@ -24005,7 +24020,7 @@ paths: operationId: DeletePrivateLocation parameters: - name: location_id - source: private_location + source: private_location.id type: unsafe /api/v1/synthetics/private-locations/{location_id}: delete: diff --git a/cassettes/v1/Synthetics_2658572017/Create-a-private-location-returns-OK-response_3848195822/frozen.json b/cassettes/v1/Synthetics_2658572017/Create-a-private-location-returns-OK-response_3848195822/frozen.json new file mode 100644 index 00000000000..8e0b9854a66 --- /dev/null +++ b/cassettes/v1/Synthetics_2658572017/Create-a-private-location-returns-OK-response_3848195822/frozen.json @@ -0,0 +1 @@ +"2022-04-07T08:48:04.711Z" diff --git a/cassettes/v1/Synthetics_2658572017/Create-a-private-location-returns-OK-response_3848195822/recording.har b/cassettes/v1/Synthetics_2658572017/Create-a-private-location-returns-OK-response_3848195822/recording.har new file mode 100644 index 00000000000..a08553914e5 --- /dev/null +++ b/cassettes/v1/Synthetics_2658572017/Create-a-private-location-returns-OK-response_3848195822/recording.har @@ -0,0 +1,194 @@ +{ + "log": { + "_recordingName": "Synthetics/Create a private location returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.4" + }, + "entries": [ + { + "_id": "a469a4353e16b2ddc02b150257d81ec3", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 111, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 550, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"name\":\"Test-Create_a_private_location_returns_OK_response-1649321284\"},\"type\":\"roles\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/roles" + }, + "response": { + "bodySize": 764, + "content": { + "mimeType": "application/json", + "size": 764, + "text": "{\"data\":{\"type\":\"roles\",\"id\":\"70a15180-b64f-11ec-93f4-da7ad0900002\",\"attributes\":{\"name\":\"Test-Create_a_private_location_returns_OK_response-1649321284\",\"created_at\":\"2022-04-07T08:48:04.992648+00:00\",\"modified_at\":\"2022-04-07T08:48:05.051654+00:00\"},\"relationships\":{\"permissions\":{\"data\":[{\"type\":\"permissions\",\"id\":\"d90f6830-d3d8-11e9-a77a-b3404e5e9ee2\"},{\"type\":\"permissions\",\"id\":\"4441648c-d8b1-11e9-a77a-1b899a04b304\"},{\"type\":\"permissions\",\"id\":\"417ba636-2dce-11eb-84c0-6bce5b0d9de0\"},{\"type\":\"permissions\",\"id\":\"12efc20e-d36c-11eb-a9b8-da7ad0900002\"},{\"type\":\"permissions\",\"id\":\"97971c1c-e895-11eb-b13c-da7ad0900002\"},{\"type\":\"permissions\",\"id\":\"7605ef24-f376-11eb-b90b-da7ad0900002\"},{\"type\":\"permissions\",\"id\":\"b6bf9ac6-9a59-11ec-8480-da7ad0900002\"}]}}}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 660, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-04-07T08:48:04.731Z", + "time": 366 + }, + { + "_id": "372f71f38e9b0a2cb329c717efeeeb0c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 310, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 584, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"description\":\"Test Test-Create_a_private_location_returns_OK_response-1649321284 description\",\"metadata\":{\"restricted_roles\":[\"70a15180-b64f-11ec-93f4-da7ad0900002\"]},\"name\":\"Test-Create_a_private_location_returns_OK_response-1649321284\",\"tags\":[\"test:testcreateaprivatelocationreturnsokresponse1649321284\"]}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/synthetics/private-locations" + }, + "response": { + "bodySize": 9507, + "content": { + "mimeType": "application/json", + "size": 9507, + "text": "{\"private_location\":{\"name\":\"Test-Create_a_private_location_returns_OK_response-1649321284\",\"tags\":[\"test:testcreateaprivatelocationreturnsokresponse1649321284\"],\"secrets\":{\"authentication\":{\"id\":\"1076d3ecc80ca8a25eb3888446cbbf55\",\"key\":\"2b4a0158170e35597514aa327eb3f83c82a893b57b4c33249b05bbc84ab5dc9a\"},\"config_decryption\":{\"id\":\"089428616e486039275d08d57aa6712a\",\"key\":\"-----BEGIN RSA PRIVATE KEY-----\\nMIIJKQIBAAKCAgEA0Wmw2RN2GkDfLTWs65sXJZxqKqsi5oXmbdvwYF6oPiRwhkbx\\njGI2AhXlBXnlJBFhvu/dTTnr5KQa96jYrAsILSl5FfMBTbIUZrwhZGYPFZZQotwZ\\nPS0noADaD7xJA5kg95+zL+VEiNgSjFwM9Tmh8etD5RE8+M259ry98H5LqWNa9+0B\\nUviUu2DGNyyZmwyXVuIWhr4kA6UYa+6OhRcq0LI0PhZebSohkszlSRdx69mszUXo\\nVAMla1VDMNXus5WuyhI0ZVSMOw5o2gaV/TyPJoilMm1RoOPcAlzGQZVoJH/LAJ/e\\nfoNcfh+fD6wvznvoRhE+tqRuT1WLAKbW+t03N3edkBHMq7iqpotDcLBtJAqf4xJi\\nFR7CtozYege25GXXxfnTEYH4Vvxm2mz0zBs10bwjQ5acgQPDEgxvNi+r0zOylL2X\\n7FsBQhXKVWz7QHQ1k7PWnXYOUZohpg+6wWS6aJ34jj+3iYR5jDgAFOnZTNnjoWvr\\nDNanEDWqFk/Q1+yEmsrU8XDgIyhK+xmzQzUtC8KkBrO1V72N1mVH0h3xp3KhzFhF\\nSTlnhkzE4fOgywMdjw2J54gDB2TcR8rhMkpOxdq6xM06WnY80tfct6IJjq0YQwWy\\nPWZyY+ASYZBCL0vk7ITCSOcT452NB7xH2dfP8gW2Fk0JDCgflmO/eydvYZkCAwEA\\nAQKCAgAVgWNcM5OwGAPjTm0S6AMtRV4gwiDsKAmVNB5AI1BnS1Iz8/Kn3kkaFzoF\\nATLfLJrLYzIolV9shE7RqqkPp/Vfv+/TqXgzjKtsLntGZnW7m4tt4ikEX4//bj72\\nmTktUasxStj5vPN4Eyp6eBSLlW7UW3sGOeo3SddEZ7cgzLOD8nRb3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PSWP63p4OdQ5oyxguQOX04Te8\\nYxt6Qqqg1I6yExM5FaWwhLsE3rGDxtZG0Xfbvaxhw7dJ09UUveZyldXJI1O1y6IJ\\nRT5IXvqdGqQOcbEc9HG85pEI5RXzvpvgIO/R2HUiuIssYhjEh3jK+cBDJ4LInGMn\\nunX9C5eaJn1TvvnlZoNoKcwKuwBVzRgmXqcZlQVRjZOvLQ8tJdzJp9kXt8yI\\n-----END RSA PRIVATE KEY-----\"}},\"modifiedAt\":\"2022-04-07T08:48:07.068713+00:00\",\"createdBy\":\"frog@datadoghq.com\",\"metadata\":{\"restricted_roles\":[\"70a15180-b64f-11ec-93f4-da7ad0900002\"]},\"config\":{\"site\":\"datadoghq.com\"},\"id\":\"pl:test-create_a_private_location_returns_ok_response-1649321284-2be2e6cf5ce1fafb7b3024389b288f4c\",\"createdAt\":\"2022-04-07T08:48:07.068713+00:00\",\"description\":\"Test Test-Create_a_private_location_returns_OK_response-1649321284 description\"},\"config\":{\"accessKey\":\"1076d3ecc80ca8a25eb3888446cbbf55\",\"privateKey\":\"-----BEGIN RSA PRIVATE KEY-----\\nMIIJKQIBAAKCAgEA0Wmw2RN2GkDfLTWs65sXJZxqKqsi5oXmbdvwYF6oPiRwhkbx\\njGI2AhXlBXnlJBFhvu/dTTnr5KQa96jYrAsILSl5FfMBTbIUZrwhZGYPFZZQotwZ\\nPS0noADaD7xJA5kg95+zL+VEiNgSjFwM9Tmh8etD5RE8+M259ry98H5LqWNa9+0B\\nUviUu2DGNyyZmwyXVuIWhr4kA6UYa+6OhRcq0LI0PhZebSohkszlSRdx69mszUXo\\nVAMla1VDMNXus5WuyhI0ZVSMOw5o2gaV/TyPJoilMm1RoOPcAlzGQZVoJH/LAJ/e\\nfoNcfh+fD6wvznvoRhE+tqRuT1WLAKbW+t03N3edkBHMq7iqpotDcLBtJAqf4xJi\\nFR7CtozYege25GXXxfnTEYH4Vvxm2mz0zBs10bwjQ5acgQPDEgxvNi+r0zOylL2X\\n7FsBQhXK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7WAWs34FBGDPtg\\nlM6erRoY5CSCP5/5x++xDzw4gfWOkawMBgS9GfBnfp3FWy9H33GwvPhBelRbxzOC\\n3FMKx5dwngWRFJYekIdwFBEJt088EwyTS9MqYGyt+5AiJVEQ7LV6Hz6HH89sbyQB\\n0QxrFQlQ38qeReA8QV6o4SVNa+JmvyHWHExX9Mnb2w1n86iYYinu1DcA+kuXvsG0\\njGeym0Uz9l/ufZrhLmFDFOMpN1J6/FK8mHGtXz2weupflNNwWWgyD1jKPn9U1ZQP\\ndYXjdBhTHU7H9beoUQ40eYpF4JGBQEu8ARgKYBGSwCsiu0zIykd9zAFndouakFSj\\nqSq1h8kNY1Yp/1NZjPbvMTXt+hNPgBBKJ+aV3Z4tl+DB7HLKrWirAX6RNeFqH6Ys\\n/CZk1xH3wTGuvBKsdEL93o8EoxhZxh0O4o7936aPYtpDucExXcqaao8jdXprs0q0\\nqvDZkEI3/aUB3LclvfXjavMCAwEAAQ==\\n-----END PUBLIC KEY-----\\n\",\"fingerprint\":\"sha256$base64$GA8WCOyWvWP6GJAGhywibAf0NuEeFgqJKZVjrCogbqU=\"},\"id\":\"pl:test-create_a_private_location_returns_ok_response-1649321284-2be2e6cf5ce1fafb7b3024389b288f4c\"},\"result_encryption\":{\"id\":\"sha256$base64$GA8WCOyWvWP6GJAGhywibAf0NuEeFgqJKZVjrCogbqU=\",\"key\":\"-----BEGIN PUBLIC KEY-----\\nMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0yCGWhamEUB1Xyp8a0lI\\nXIJX9xEGS4Os467tfjMXF8SJj2+47EqZNNB0SPbesethiTH/3zVvsFhzCtXOfuKG\\nNZIN+6IWVEIsecgiFGYPnCdnOawzKTPHzE+sD/ipbJCkINvbbcgmxYE5Hw1Ju26n\\nneFv25fKTAI/JHETBMQGxFbcJ4QU2IdJrQ6Er7mT6s1BT/HO7X7WAWs34FBGDPtg\\nlM6erRoY5CSCP5/5x++xDzw4gfWOkawMBgS9GfBnfp3FWy9H33GwvPhBelRbxzOC\\n3FMKx5dwngWRFJYekIdwFBEJt088EwyTS9MqYGyt+5AiJVEQ7LV6Hz6HH89sbyQB\\n0QxrFQlQ38qeReA8QV6o4SVNa+JmvyHWHExX9Mnb2w1n86iYYinu1DcA+kuXvsG0\\njGeym0Uz9l/ufZrhLmFDFOMpN1J6/FK8mHGtXz2weupflNNwWWgyD1jKPn9U1ZQP\\ndYXjdBhTHU7H9beoUQ40eYpF4JGBQEu8ARgKYBGSwCsiu0zIykd9zAFndouakFSj\\nqSq1h8kNY1Yp/1NZjPbvMTXt+hNPgBBKJ+aV3Z4tl+DB7HLKrWirAX6RNeFqH6Ys\\n/CZk1xH3wTGuvBKsdEL93o8EoxhZxh0O4o7936aPYtpDucExXcqaao8jdXprs0q0\\nqvDZkEI3/aUB3LclvfXjavMCAwEAAQ==\\n-----END PUBLIC KEY-----\\n\"}}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 637, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2022-04-07T08:48:05.106Z", + "time": 2035 + }, + { + "_id": "d9d11b3ca9fe22b5ae882c11bef83dff", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 633, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v1/synthetics/private-locations/pl%3Atest-create_a_private_location_returns_ok_response-1649321284-2be2e6cf5ce1fafb7b3024389b288f4c" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 583, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2022-04-07T08:48:07.168Z", + "time": 463 + }, + { + "_id": "9e449e63abc95c4ebde8c91aff4b7137", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 536, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/roles/70a15180-b64f-11ec-93f4-da7ad0900002" + }, + "response": { + "bodySize": 0, + "content": { + "mimeType": "text/plain", + "size": 0 + }, + "cookies": [], + "headers": [], + "headersSize": 607, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 204, + "statusText": "No Content" + }, + "startedDateTime": "2022-04-07T08:48:07.635Z", + "time": 305 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/examples/v1/synthetics/CreateGlobalVariable.ts b/examples/v1/synthetics/CreateGlobalVariable.ts index 0d33f4fb0cd..f9f8dafe326 100644 --- a/examples/v1/synthetics/CreateGlobalVariable.ts +++ b/examples/v1/synthetics/CreateGlobalVariable.ts @@ -10,7 +10,7 @@ const apiInstance = new v1.SyntheticsApi(configuration); const params: v1.SyntheticsApiCreateGlobalVariableRequest = { body: { attributes: { - restrictedRoles: [], + restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], }, description: "Example description", name: "MY_VARIABLE", diff --git a/examples/v1/synthetics/CreatePrivateLocation.ts b/examples/v1/synthetics/CreatePrivateLocation.ts index 0a9e99ab806..f1dbd0d2cf4 100644 --- a/examples/v1/synthetics/CreatePrivateLocation.ts +++ b/examples/v1/synthetics/CreatePrivateLocation.ts @@ -7,11 +7,18 @@ import { v1 } from "@datadog/datadog-api-client"; const configuration = v1.createConfiguration(); const apiInstance = new v1.SyntheticsApi(configuration); +// there is a valid "role" in the system +const ROLE_DATA_ID = process.env.ROLE_DATA_ID as string; + const params: v1.SyntheticsApiCreatePrivateLocationRequest = { body: { - description: "Description of private location", - name: "New private location", - tags: ["team:front"], + description: + "Test Example-Create_a_private_location_returns_OK_response description", + metadata: { + restrictedRoles: [ROLE_DATA_ID], + }, + name: "Example-Create_a_private_location_returns_OK_response", + tags: ["test:examplecreateaprivatelocationreturnsokresponse"], }, }; diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest.ts b/examples/v1/synthetics/CreateSyntheticsAPITest.ts index 3708830ad2b..7e5eae7fc0d 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest.ts +++ b/examples/v1/synthetics/CreateSyntheticsAPITest.ts @@ -28,6 +28,7 @@ const params: v1.SyntheticsApiCreateSyntheticsAPITestRequest = { options: { deviceIds: ["laptop_large"], monitorOptions: {}, + restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], retry: {}, }, status: "live", diff --git a/examples/v1/synthetics/EditGlobalVariable.ts b/examples/v1/synthetics/EditGlobalVariable.ts index 0030e47b109..de1295a528a 100644 --- a/examples/v1/synthetics/EditGlobalVariable.ts +++ b/examples/v1/synthetics/EditGlobalVariable.ts @@ -10,7 +10,7 @@ const apiInstance = new v1.SyntheticsApi(configuration); const params: v1.SyntheticsApiEditGlobalVariableRequest = { body: { attributes: { - restrictedRoles: [], + restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], }, description: "Example description", name: "MY_VARIABLE", diff --git a/examples/v1/synthetics/UpdateBrowserTest.ts b/examples/v1/synthetics/UpdateBrowserTest.ts index e23ce540714..cff380ffaea 100644 --- a/examples/v1/synthetics/UpdateBrowserTest.ts +++ b/examples/v1/synthetics/UpdateBrowserTest.ts @@ -46,6 +46,7 @@ const params: v1.SyntheticsApiUpdateBrowserTestRequest = { options: { deviceIds: ["laptop_large"], monitorOptions: {}, + restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], retry: {}, }, status: "live", diff --git a/examples/v1/synthetics/UpdatePrivateLocation.ts b/examples/v1/synthetics/UpdatePrivateLocation.ts index 3a42a5ce011..27b6f5b7ff0 100644 --- a/examples/v1/synthetics/UpdatePrivateLocation.ts +++ b/examples/v1/synthetics/UpdatePrivateLocation.ts @@ -10,6 +10,9 @@ const apiInstance = new v1.SyntheticsApi(configuration); const params: v1.SyntheticsApiUpdatePrivateLocationRequest = { body: { description: "Description of private location", + metadata: { + restrictedRoles: ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], + }, name: "New private location", tags: ["team:front"], }, diff --git a/features/v1/synthetics.feature b/features/v1/synthetics.feature index 8a679fa1634..fe8b8d65939 100644 --- a/features/v1/synthetics.feature +++ b/features/v1/synthetics.feature @@ -34,7 +34,7 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-app Scenario: Create a browser test returns "- JSON format is wrong" response Given new "CreateSyntheticsBrowserTest" request - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "retry": {}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -49,42 +49,43 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-app Scenario: Create a browser test returns "Test quota is reached" response Given new "CreateSyntheticsBrowserTest" request - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "retry": {}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 402 Test quota is reached @generated @skip @team:DataDog/synthetics-app Scenario: Create a global variable returns "Invalid request" response Given new "CreateGlobalVariable" request - And body with value {"attributes": {"restricted_roles": []}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}} + And body with value {"attributes": {"restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}} When the request is sent Then the response status is 400 Invalid request @generated @skip @team:DataDog/synthetics-app Scenario: Create a global variable returns "OK" response Given new "CreateGlobalVariable" request - And body with value {"attributes": {"restricted_roles": []}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}} + And body with value {"attributes": {"restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}} When the request is sent Then the response status is 200 OK - @generated @skip @team:DataDog/synthetics-app + @team:DataDog/synthetics-app Scenario: Create a private location returns "OK" response - Given new "CreatePrivateLocation" request - And body with value {"description": "Description of private location", "name": "New private location", "tags": ["team:front"]} + Given there is a valid "role" in the system + And new "CreatePrivateLocation" request + And body with value {"description": "Test {{ unique }} description", "metadata": {"restricted_roles": ["{{ role.data.id }}"]}, "name": "{{ unique }}", "tags": ["test:{{ unique_lower_alnum }}"]} When the request is sent Then the response status is 200 OK @generated @skip @team:DataDog/synthetics-app Scenario: Create a private location returns "Private locations are not activated for the user" response Given new "CreatePrivateLocation" request - And body with value {"description": "Description of private location", "name": "New private location", "tags": ["team:front"]} + And body with value {"description": "Description of private location", "metadata": {"restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]}, "name": "New private location", "tags": ["team:front"]} When the request is sent Then the response status is 404 Private locations are not activated for the user @generated @skip @team:DataDog/synthetics-app Scenario: Create a private location returns "Quota reached for private locations" response Given new "CreatePrivateLocation" request - And body with value {"description": "Description of private location", "name": "New private location", "tags": ["team:front"]} + And body with value {"description": "Description of private location", "metadata": {"restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]}, "name": "New private location", "tags": ["team:front"]} When the request is sent Then the response status is 402 Quota reached for private locations @@ -107,21 +108,21 @@ Feature: Synthetics @generated @skip @team:DataDog/synthetics-app Scenario: Create an API test returns "- JSON format is wrong" response Given new "CreateSyntheticsAPITest" request - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "retry": {}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 400 - JSON format is wrong @generated @skip @team:DataDog/synthetics-app Scenario: Create an API test returns "OK - Returns the created test details." response Given new "CreateSyntheticsAPITest" request - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "retry": {}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 200 OK - Returns the created test details. @generated @skip @team:DataDog/synthetics-app Scenario: Create an API test returns "Test quota is reached" response Given new "CreateSyntheticsAPITest" request - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "retry": {}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 402 Test quota is reached @@ -213,7 +214,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "- JSON format is wrong" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "retry": {}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -221,7 +222,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "- Synthetic Monitoring is not activated for the user" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "retry": {}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 404 - Synthetic Monitoring is not activated for the user @@ -229,7 +230,7 @@ Feature: Synthetics Scenario: Edit a browser test returns "OK" response Given new "UpdateBrowserTest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "retry": {}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} + And body with value {"config": {"assertions": [], "configVariables": [{"name": "VARIABLE_NAME", "type": "text"}], "request": {"basicAuth": {"password": "PaSSw0RD!", "type": "web", "username": "my_username"}, "certificate": {"cert": {}, "key": {}}, "method": "GET", "proxy": {"url": "https://example.com"}, "url": "https://example.com"}, "variables": [{"name": "VARIABLE_NAME", "type": "text"}]}, "locations": ["aws:eu-west-3"], "message": "", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}}, "status": "live", "steps": [{"type": "assertElementContent"}], "tags": ["env:prod"], "type": "browser"} When the request is sent Then the response status is 200 OK @@ -237,7 +238,7 @@ Feature: Synthetics Scenario: Edit a global variable returns "Invalid request" response Given new "EditGlobalVariable" request And request contains "variable_id" parameter from "REPLACE.ME" - And body with value {"attributes": {"restricted_roles": []}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}} + And body with value {"attributes": {"restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}} When the request is sent Then the response status is 400 Invalid request @@ -245,7 +246,7 @@ Feature: Synthetics Scenario: Edit a global variable returns "OK" response Given new "EditGlobalVariable" request And request contains "variable_id" parameter from "REPLACE.ME" - And body with value {"attributes": {"restricted_roles": []}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}} + And body with value {"attributes": {"restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]}, "description": "Example description", "name": "MY_VARIABLE", "parse_test_options": {"field": "content-type", "parser": {"type": "regex", "value": ".*"}, "type": "http_body"}, "parse_test_public_id": "abc-def-123", "tags": ["team:front", "test:workflow-1"], "value": {"secure": true, "value": "value"}} When the request is sent Then the response status is 200 OK @@ -253,7 +254,7 @@ Feature: Synthetics Scenario: Edit a private location returns "- Private locations are not activated for the user" response Given new "UpdatePrivateLocation" request And request contains "location_id" parameter from "REPLACE.ME" - And body with value {"description": "Description of private location", "name": "New private location", "tags": ["team:front"]} + And body with value {"description": "Description of private location", "metadata": {"restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]}, "name": "New private location", "tags": ["team:front"]} When the request is sent Then the response status is 404 - Private locations are not activated for the user @@ -261,7 +262,7 @@ Feature: Synthetics Scenario: Edit a private location returns "OK" response Given new "UpdatePrivateLocation" request And request contains "location_id" parameter from "REPLACE.ME" - And body with value {"description": "Description of private location", "name": "New private location", "tags": ["team:front"]} + And body with value {"description": "Description of private location", "metadata": {"restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]}, "name": "New private location", "tags": ["team:front"]} When the request is sent Then the response status is 200 OK @@ -269,7 +270,7 @@ Feature: Synthetics Scenario: Edit an API test returns "- JSON format is wrong" response Given new "UpdateAPITest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "retry": {}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 400 - JSON format is wrong @@ -277,7 +278,7 @@ Feature: Synthetics Scenario: Edit an API test returns "- Synthetic Monitoring is not activated for the user" response Given new "UpdateAPITest" request And request contains "public_id" parameter from "REPLACE.ME" - And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "retry": {}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} + And body with value {"config": {"assertions": [{"operator": "lessThan", "target": 1000, "type": "responseTime"}], "request": {"method": "GET", "url": "https://example.com"}}, "locations": ["aws:eu-west-3"], "message": "Notification message", "name": "Example test name", "options": {"device_ids": ["laptop_large"], "monitor_options": {}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}}, "status": "live", "subtype": "http", "tags": ["env:production"], "type": "api"} When the request is sent Then the response status is 404 - Synthetic Monitoring is not activated for the user diff --git a/features/v1/undo.json b/features/v1/undo.json index 2dc6d57d8e4..4fb7b8ceb8c 100644 --- a/features/v1/undo.json +++ b/features/v1/undo.json @@ -958,7 +958,7 @@ "parameters": [ { "name": "location_id", - "source": "private_location" + "source": "private_location.id" } ], "type": "unsafe" diff --git a/packages/datadog-api-client-v1/.openapi-generator/FILES b/packages/datadog-api-client-v1/.openapi-generator/FILES index e9da858c0e6..f255d1fb879 100644 --- a/packages/datadog-api-client-v1/.openapi-generator/FILES +++ b/packages/datadog-api-client-v1/.openapi-generator/FILES @@ -553,6 +553,7 @@ models/SyntheticsPlayingTab.ts models/SyntheticsPrivateLocation.ts models/SyntheticsPrivateLocationCreationResponse.ts models/SyntheticsPrivateLocationCreationResponseResultEncryption.ts +models/SyntheticsPrivateLocationMetadata.ts models/SyntheticsPrivateLocationSecrets.ts models/SyntheticsPrivateLocationSecretsAuthentication.ts models/SyntheticsPrivateLocationSecretsConfigDecryption.ts diff --git a/packages/datadog-api-client-v1/index.ts b/packages/datadog-api-client-v1/index.ts index 744ddf0d169..6a3a843aedc 100644 --- a/packages/datadog-api-client-v1/index.ts +++ b/packages/datadog-api-client-v1/index.ts @@ -801,6 +801,7 @@ export { SyntheticsPlayingTab } from "./models/SyntheticsPlayingTab"; export { SyntheticsPrivateLocation } from "./models/SyntheticsPrivateLocation"; export { SyntheticsPrivateLocationCreationResponse } from "./models/SyntheticsPrivateLocationCreationResponse"; export { SyntheticsPrivateLocationCreationResponseResultEncryption } from "./models/SyntheticsPrivateLocationCreationResponseResultEncryption"; +export { SyntheticsPrivateLocationMetadata } from "./models/SyntheticsPrivateLocationMetadata"; export { SyntheticsPrivateLocationSecrets } from "./models/SyntheticsPrivateLocationSecrets"; export { SyntheticsPrivateLocationSecretsAuthentication } from "./models/SyntheticsPrivateLocationSecretsAuthentication"; export { SyntheticsPrivateLocationSecretsConfigDecryption } from "./models/SyntheticsPrivateLocationSecretsConfigDecryption"; diff --git a/packages/datadog-api-client-v1/models/ObjectSerializer.ts b/packages/datadog-api-client-v1/models/ObjectSerializer.ts index 9d008fc9134..eefd3353cf6 100644 --- a/packages/datadog-api-client-v1/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v1/models/ObjectSerializer.ts @@ -359,6 +359,7 @@ import { SyntheticsParsingOptions } from "./SyntheticsParsingOptions"; import { SyntheticsPrivateLocation } from "./SyntheticsPrivateLocation"; import { SyntheticsPrivateLocationCreationResponse } from "./SyntheticsPrivateLocationCreationResponse"; import { SyntheticsPrivateLocationCreationResponseResultEncryption } from "./SyntheticsPrivateLocationCreationResponseResultEncryption"; +import { SyntheticsPrivateLocationMetadata } from "./SyntheticsPrivateLocationMetadata"; import { SyntheticsPrivateLocationSecrets } from "./SyntheticsPrivateLocationSecrets"; import { SyntheticsPrivateLocationSecretsAuthentication } from "./SyntheticsPrivateLocationSecretsAuthentication"; import { SyntheticsPrivateLocationSecretsConfigDecryption } from "./SyntheticsPrivateLocationSecretsConfigDecryption"; @@ -1558,6 +1559,7 @@ const typeMap: { [index: string]: any } = { SyntheticsPrivateLocationCreationResponse, SyntheticsPrivateLocationCreationResponseResultEncryption: SyntheticsPrivateLocationCreationResponseResultEncryption, + SyntheticsPrivateLocationMetadata: SyntheticsPrivateLocationMetadata, SyntheticsPrivateLocationSecrets: SyntheticsPrivateLocationSecrets, SyntheticsPrivateLocationSecretsAuthentication: SyntheticsPrivateLocationSecretsAuthentication, diff --git a/packages/datadog-api-client-v1/models/SyntheticsGlobalVariableAttributes.ts b/packages/datadog-api-client-v1/models/SyntheticsGlobalVariableAttributes.ts index 11ee1fd75dd..dba329d3d06 100644 --- a/packages/datadog-api-client-v1/models/SyntheticsGlobalVariableAttributes.ts +++ b/packages/datadog-api-client-v1/models/SyntheticsGlobalVariableAttributes.ts @@ -16,7 +16,7 @@ import { AttributeTypeMap } from "../util"; export class SyntheticsGlobalVariableAttributes { /** - * List of role identifiers that can be pulled from the Roles API. + * A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. */ "restrictedRoles"?: Array; diff --git a/packages/datadog-api-client-v1/models/SyntheticsPrivateLocation.ts b/packages/datadog-api-client-v1/models/SyntheticsPrivateLocation.ts index c178f7bdeba..94674058c54 100644 --- a/packages/datadog-api-client-v1/models/SyntheticsPrivateLocation.ts +++ b/packages/datadog-api-client-v1/models/SyntheticsPrivateLocation.ts @@ -8,6 +8,7 @@ * Do not edit the class manually. */ +import { SyntheticsPrivateLocationMetadata } from "./SyntheticsPrivateLocationMetadata"; import { SyntheticsPrivateLocationSecrets } from "./SyntheticsPrivateLocationSecrets"; import { AttributeTypeMap } from "../util"; @@ -24,6 +25,7 @@ export class SyntheticsPrivateLocation { * Unique identifier of the private location. */ "id"?: string; + "metadata"?: SyntheticsPrivateLocationMetadata; /** * Name of the private location. */ @@ -52,6 +54,10 @@ export class SyntheticsPrivateLocation { baseName: "id", type: "string", }, + metadata: { + baseName: "metadata", + type: "SyntheticsPrivateLocationMetadata", + }, name: { baseName: "name", type: "string", diff --git a/packages/datadog-api-client-v1/models/SyntheticsPrivateLocationMetadata.ts b/packages/datadog-api-client-v1/models/SyntheticsPrivateLocationMetadata.ts new file mode 100644 index 00000000000..939200f4972 --- /dev/null +++ b/packages/datadog-api-client-v1/models/SyntheticsPrivateLocationMetadata.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. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { AttributeTypeMap } from "../util"; + +/** + * Object containing metadata about the private location. + */ + +export class SyntheticsPrivateLocationMetadata { + /** + * A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. + */ + "restrictedRoles"?: Array; + + /** + * @ignore + */ + "unparsedObject"?: any; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + restrictedRoles: { + baseName: "restricted_roles", + type: "Array", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsPrivateLocationMetadata.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v1/models/SyntheticsTestOptions.ts b/packages/datadog-api-client-v1/models/SyntheticsTestOptions.ts index 3d5db8abebc..fc0e1ee79a8 100644 --- a/packages/datadog-api-client-v1/models/SyntheticsTestOptions.ts +++ b/packages/datadog-api-client-v1/models/SyntheticsTestOptions.ts @@ -63,6 +63,10 @@ export class SyntheticsTestOptions { * Prevents saving screenshots of the steps. */ "noScreenshot"?: boolean; + /** + * A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. + */ + "restrictedRoles"?: Array; "retry"?: SyntheticsTestOptionsRetry; /** * The frequency at which to run the Synthetic test (in seconds). @@ -129,6 +133,10 @@ export class SyntheticsTestOptions { baseName: "noScreenshot", type: "boolean", }, + restrictedRoles: { + baseName: "restricted_roles", + type: "Array", + }, retry: { baseName: "retry", type: "SyntheticsTestOptionsRetry",