From ff7da40c2428545b56c6eced45d06e4f52fec346 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 26 Aug 2025 20:30:25 +0000 Subject: [PATCH] Regenerate client from commit d2e7ec5 of spec repo --- .generated-info | 4 +- .generator/schemas/v2/openapi.yaml | 407 ++++++++++++ .../frozen.json | 1 + .../recording.har | 67 ++ .../frozen.json | 1 + .../recording.har | 163 +++++ .../frozen.json | 1 + .../recording.har | 67 ++ .../frozen.json | 1 + .../recording.har | 110 ++++ .../frozen.json | 1 + .../recording.har | 57 ++ .../frozen.json | 1 + .../recording.har | 57 ++ .../frozen.json | 1 + .../recording.har | 153 +++++ .../frozen.json | 1 + .../recording.har | 57 ++ .../frozen.json | 1 + .../recording.har | 163 +++++ .../frozen.json | 1 + .../recording.har | 163 +++++ .../frozen.json | 1 + .../recording.har | 163 +++++ features/v2/given.json | 13 + features/v2/org_connections.feature | 95 +++ features/v2/undo.json | 31 + packages/datadog-api-client/README.md | 1 + .../src/support/scenarios_model_mapping.ts | 28 + services/org_connections/.yarnrc.yml | 1 + services/org_connections/README.md | 35 + services/org_connections/package.json | 43 ++ services/org_connections/src/index.ts | 3 + .../src/v2/OrgConnectionsApi.ts | 597 ++++++++++++++++++ services/org_connections/src/v2/index.ts | 30 + .../src/v2/models/APIErrorResponse.ts | 45 ++ .../src/v2/models/OrgConnection.ts | 77 +++ .../src/v2/models/OrgConnectionAttributes.ts | 57 ++ .../src/v2/models/OrgConnectionCreate.ts | 67 ++ .../models/OrgConnectionCreateAttributes.ts | 47 ++ .../OrgConnectionCreateRelationships.ts | 47 ++ .../v2/models/OrgConnectionCreateRequest.ts | 47 ++ .../v2/models/OrgConnectionListResponse.ts | 56 ++ .../models/OrgConnectionListResponseMeta.ts | 46 ++ .../OrgConnectionListResponseMetaPage.ts | 54 ++ .../v2/models/OrgConnectionOrgRelationship.ts | 46 ++ .../OrgConnectionOrgRelationshipData.ts | 62 ++ .../OrgConnectionOrgRelationshipDataType.ts | 7 + .../v2/models/OrgConnectionRelationships.ts | 63 ++ .../src/v2/models/OrgConnectionResponse.ts | 47 ++ .../src/v2/models/OrgConnectionType.ts | 7 + .../src/v2/models/OrgConnectionTypeEnum.ts | 11 + .../src/v2/models/OrgConnectionUpdate.ts | 67 ++ .../models/OrgConnectionUpdateAttributes.ts | 47 ++ .../v2/models/OrgConnectionUpdateRequest.ts | 47 ++ .../models/OrgConnectionUserRelationship.ts | 46 ++ .../OrgConnectionUserRelationshipData.ts | 62 ++ .../OrgConnectionUserRelationshipDataType.ts | 9 + .../src/v2/models/TypingInfo.ts | 52 ++ services/org_connections/tsconfig.json | 28 + yarn.lock | 9 + 61 files changed, 3670 insertions(+), 2 deletions(-) create mode 100644 cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Bad-Request-response_377247719/frozen.json create mode 100644 cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Bad-Request-response_377247719/recording.har create mode 100644 cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Conflict-response_2748509155/frozen.json create mode 100644 cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Conflict-response_2748509155/recording.har create mode 100644 cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Not-Found-response_1760104000/frozen.json create mode 100644 cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Not-Found-response_1760104000/recording.har create mode 100644 cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-OK-response_1410740483/frozen.json create mode 100644 cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-OK-response_1410740483/recording.har create mode 100644 cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Bad-Request-response_2749209244/frozen.json create mode 100644 cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Bad-Request-response_2749209244/recording.har create mode 100644 cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Not-Found-response_1076827547/frozen.json create mode 100644 cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Not-Found-response_1076827547/recording.har create mode 100644 cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-OK-response_2943596482/frozen.json create mode 100644 cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-OK-response_2943596482/recording.har create mode 100644 cassettes/v2/Org-Connections_1174763688/List-Org-Connections-returns-OK-response_1051001000/frozen.json create mode 100644 cassettes/v2/Org-Connections_1174763688/List-Org-Connections-returns-OK-response_1051001000/recording.har create mode 100644 cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Bad-Request-response_1023592838/frozen.json create mode 100644 cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Bad-Request-response_1023592838/recording.har create mode 100644 cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Not-Found-response_1519971277/frozen.json create mode 100644 cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Not-Found-response_1519971277/recording.har create mode 100644 cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-OK-response_3589373708/frozen.json create mode 100644 cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-OK-response_3589373708/recording.har create mode 100644 features/v2/org_connections.feature create mode 100644 services/org_connections/.yarnrc.yml create mode 100644 services/org_connections/README.md create mode 100644 services/org_connections/package.json create mode 100644 services/org_connections/src/index.ts create mode 100644 services/org_connections/src/v2/OrgConnectionsApi.ts create mode 100644 services/org_connections/src/v2/index.ts create mode 100644 services/org_connections/src/v2/models/APIErrorResponse.ts create mode 100644 services/org_connections/src/v2/models/OrgConnection.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionAttributes.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionCreate.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionCreateAttributes.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionCreateRelationships.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionCreateRequest.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionListResponse.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionListResponseMeta.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionListResponseMetaPage.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionOrgRelationship.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionOrgRelationshipData.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionOrgRelationshipDataType.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionRelationships.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionResponse.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionType.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionTypeEnum.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionUpdate.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionUpdateAttributes.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionUpdateRequest.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionUserRelationship.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionUserRelationshipData.ts create mode 100644 services/org_connections/src/v2/models/OrgConnectionUserRelationshipDataType.ts create mode 100644 services/org_connections/src/v2/models/TypingInfo.ts create mode 100644 services/org_connections/tsconfig.json diff --git a/.generated-info b/.generated-info index 85b4133ea858..2452d691437e 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "1e6c346", - "generated": "2025-08-25 18:45:49.323" + "spec_repo_commit": "d2e7ec5", + "generated": "2025-08-26 20:30:25.213" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3705ce533ddd..efe7fcf36a9b 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -681,6 +681,15 @@ components: schema: example: monitor_timezone type: string + OrgConnectionId: + description: The unique identifier of the org connection. + in: path + name: connection_id + required: true + schema: + example: f9ec96b0-8c8a-4b0a-9b0a-1b2c3d4e5f6a + format: uuid + type: string PageNumber: description: Specific page number to return. in: query @@ -30890,6 +30899,255 @@ components: required: - data type: object + OrgConnection: + description: An org connection. + properties: + attributes: + $ref: '#/components/schemas/OrgConnectionAttributes' + id: + description: The unique identifier of the org connection. + example: f9ec96b0-8c8a-4b0a-9b0a-1b2c3d4e5f6a + format: uuid + type: string + relationships: + $ref: '#/components/schemas/OrgConnectionRelationships' + type: + $ref: '#/components/schemas/OrgConnectionType' + required: + - id + - type + - attributes + - relationships + type: object + OrgConnectionAttributes: + description: Org connection attributes. + properties: + connection_types: + description: List of connection types. + example: + - logs + - metrics + items: + $ref: '#/components/schemas/OrgConnectionTypeEnum' + type: array + created_at: + description: Timestamp when the connection was created. + example: '2023-01-01T12:00:00Z' + format: date-time + type: string + required: + - connection_types + - created_at + type: object + OrgConnectionCreate: + description: Org connection creation data. + properties: + attributes: + $ref: '#/components/schemas/OrgConnectionCreateAttributes' + relationships: + $ref: '#/components/schemas/OrgConnectionCreateRelationships' + type: + $ref: '#/components/schemas/OrgConnectionType' + required: + - type + - attributes + - relationships + type: object + OrgConnectionCreateAttributes: + description: Attributes for creating an org connection. + properties: + connection_types: + description: List of connection types to establish. + example: + - logs + items: + $ref: '#/components/schemas/OrgConnectionTypeEnum' + minItems: 1 + type: array + required: + - connection_types + type: object + OrgConnectionCreateRelationships: + description: Relationships for org connection creation. + properties: + sink_org: + $ref: '#/components/schemas/OrgConnectionOrgRelationship' + required: + - sink_org + type: object + OrgConnectionCreateRequest: + description: Request to create an org connection. + properties: + data: + $ref: '#/components/schemas/OrgConnectionCreate' + required: + - data + type: object + OrgConnectionListResponse: + description: Response containing a list of org connections. + properties: + data: + description: List of org connections. + items: + $ref: '#/components/schemas/OrgConnection' + type: array + meta: + $ref: '#/components/schemas/OrgConnectionListResponseMeta' + required: + - data + type: object + OrgConnectionListResponseMeta: + description: Pagination metadata. + properties: + page: + $ref: '#/components/schemas/OrgConnectionListResponseMetaPage' + type: object + OrgConnectionListResponseMetaPage: + description: Page information. + properties: + total_count: + description: Total number of org connections. + example: 0 + format: int64 + type: integer + total_filtered_count: + description: Total number of org connections matching the filter. + example: 0 + format: int64 + type: integer + type: object + OrgConnectionOrgRelationship: + description: Org relationship. + properties: + data: + $ref: '#/components/schemas/OrgConnectionOrgRelationshipData' + type: object + OrgConnectionOrgRelationshipData: + description: The definition of `OrgConnectionOrgRelationshipData` object. + properties: + id: + description: Org UUID. + example: f9ec96b0-8c8a-4b0a-9b0a-1b2c3d4e5f6a + type: string + name: + description: Org name. + example: Example Org + type: string + type: + $ref: '#/components/schemas/OrgConnectionOrgRelationshipDataType' + type: object + OrgConnectionOrgRelationshipDataType: + description: The type of the organization relationship. + enum: + - orgs + example: orgs + type: string + x-enum-varnames: + - ORGS + OrgConnectionRelationships: + description: Related organizations and user. + properties: + created_by: + $ref: '#/components/schemas/OrgConnectionUserRelationship' + sink_org: + $ref: '#/components/schemas/OrgConnectionOrgRelationship' + source_org: + $ref: '#/components/schemas/OrgConnectionOrgRelationship' + type: object + OrgConnectionResponse: + description: Response containing a single org connection. + properties: + data: + $ref: '#/components/schemas/OrgConnection' + required: + - data + type: object + OrgConnectionType: + description: Org connection type. + enum: + - org_connection + example: org_connection + type: string + x-enum-varnames: + - ORG_CONNECTION + OrgConnectionTypeEnum: + description: Available connection types between organizations. + enum: + - logs + - metrics + example: logs + type: string + x-enum-varnames: + - LOGS + - METRICS + OrgConnectionUpdate: + description: Org connection update data. + properties: + attributes: + $ref: '#/components/schemas/OrgConnectionUpdateAttributes' + id: + description: The unique identifier of the org connection. + example: f9ec96b0-8c8a-4b0a-9b0a-1b2c3d4e5f6a + format: uuid + type: string + type: + $ref: '#/components/schemas/OrgConnectionType' + required: + - type + - id + - attributes + type: object + OrgConnectionUpdateAttributes: + description: Attributes for updating an org connection. + properties: + connection_types: + description: Updated list of connection types. + example: + - logs + - metrics + items: + $ref: '#/components/schemas/OrgConnectionTypeEnum' + minItems: 1 + type: array + required: + - connection_types + type: object + OrgConnectionUpdateRequest: + description: Request to update an org connection. + properties: + data: + $ref: '#/components/schemas/OrgConnectionUpdate' + required: + - data + type: object + OrgConnectionUserRelationship: + description: User relationship. + properties: + data: + $ref: '#/components/schemas/OrgConnectionUserRelationshipData' + type: object + OrgConnectionUserRelationshipData: + description: The data for a user relationship. + properties: + id: + description: User UUID. + example: usr123abc456 + type: string + name: + description: User name. + example: John Doe + type: string + type: + $ref: '#/components/schemas/OrgConnectionUserRelationshipDataType' + type: object + OrgConnectionUserRelationshipDataType: + description: The type of the user relationship. + enum: + - users + example: users + type: string + x-enum-varnames: + - USERS Organization: description: Organization object. properties: @@ -45656,6 +45914,8 @@ components: is not required to set downtimes. monitors_read: View monitors. monitors_write: Edit, delete, and resolve individual monitors. + org_connections_read: Read cross organization connections. + org_connections_write: Create, edit, and delete cross organization connections. org_management: Edit org configurations, including authentication and certain security preferences such as configuring SAML, renaming an org, configuring allowed login methods, creating child orgs, subscribing @@ -58869,6 +59129,148 @@ paths: operator: OR permissions: - org_management + /api/v2/org_connections: + get: + description: Returns a list of org connections. + operationId: ListOrgConnections + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OrgConnectionListResponse' + description: OK + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_connections_read + summary: List Org Connections + tags: + - Org Connections + x-permission: + operator: OR + permissions: + - org_connections_read + post: + description: Create a new org connection between the current org and a target + org. + operationId: CreateOrgConnections + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrgConnectionCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OrgConnectionResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - org_connections_write + summary: Create Org Connection + tags: + - Org Connections + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - org_connections_write + /api/v2/org_connections/{connection_id}: + delete: + description: Delete an existing org connection. + operationId: DeleteOrgConnections + parameters: + - $ref: '#/components/parameters/OrgConnectionId' + responses: + '200': + 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: + - org_connections_write + summary: Delete Org Connection + tags: + - Org Connections + x-permission: + operator: OR + permissions: + - org_connections_write + patch: + description: Update an existing org connection. + operationId: UpdateOrgConnections + parameters: + - $ref: '#/components/parameters/OrgConnectionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrgConnectionUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OrgConnectionResponse' + 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: + - org_connections_write + summary: Update Org Connection + tags: + - Org Connections + x-permission: + operator: OR + permissions: + - org_connections_write /api/v2/permissions: get: description: Returns a list of all permissions, including name, description, @@ -69197,6 +69599,11 @@ tags: externalDocs: url: https://docs.datadoghq.com/api/latest/opsgenie-integration name: Opsgenie Integration +- description: Manage connections between organizations. Org connections allow for + controlled sharing of data between different Datadog organizations. See the [Cross-Organization + Visibiltiy](https://docs.datadoghq.com/account_management/org_settings/cross_org_visibility/) + page for more information. + name: Org Connections - description: Create, edit, and manage your organizations. Read more about [multi-org accounts](https://docs.datadoghq.com/account_management/multi_organization). externalDocs: diff --git a/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Bad-Request-response_377247719/frozen.json b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Bad-Request-response_377247719/frozen.json new file mode 100644 index 000000000000..dafdef215bba --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Bad-Request-response_377247719/frozen.json @@ -0,0 +1 @@ +"2025-08-26T20:19:35.269Z" diff --git a/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Bad-Request-response_377247719/recording.har b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Bad-Request-response_377247719/recording.har new file mode 100644 index 000000000000..a9e96e22918a --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Bad-Request-response_377247719/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Org Connections/Create Org Connection returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "7a21408452ccd5a61e91557a7b822b3c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 182, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\",\"logs\"]},\"relationships\":{\"sink_org\":{\"data\":{\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"type\":\"orgs\"}}},\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections" + }, + "response": { + "bodySize": 131, + "content": { + "mimeType": "application/json", + "size": 131, + "text": "{\"errors\":[\"connection between orgs 4dee724d-00cc-11ea-a77b-570c9d03c6c5 and 83999dcd-7f97-11f0-8de1-1ecf66f1aa85 is not allowed\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 686, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-08-26T20:19:35.273Z", + "time": 150 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Conflict-response_2748509155/frozen.json b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Conflict-response_2748509155/frozen.json new file mode 100644 index 000000000000..f4ba4890a5c8 --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Conflict-response_2748509155/frozen.json @@ -0,0 +1 @@ +"2025-08-26T20:19:35.429Z" diff --git a/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Conflict-response_2748509155/recording.har b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Conflict-response_2748509155/recording.har new file mode 100644 index 000000000000..9ecae80e2694 --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Conflict-response_2748509155/recording.har @@ -0,0 +1,163 @@ +{ + "log": { + "_recordingName": "Org Connections/Create Org Connection returns \"Conflict\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "76efebf6d204c8e85a8cbd11c0a4ae43", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 175, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\"]},\"relationships\":{\"sink_org\":{\"data\":{\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"type\":\"orgs\"}}},\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections" + }, + "response": { + "bodySize": 520, + "content": { + "mimeType": "application/json", + "size": 520, + "text": "{\"data\":{\"type\":\"org_connection\",\"id\":\"b5d3a360-d6e2-4af7-8da2-b2ff41b9f5e0\",\"attributes\":{\"created_at\":\"2025-08-26T20:19:35.554634+00:00\",\"connection_types\":[\"logs\"]},\"relationships\":{\"source_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\",\"name\":\"DD Integration Tests (321813)\"}},\"sink_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"name\":\"Cross-Org BDD Test Org\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"03e6bc43-7ecc-11f0-b50b-f28f2be41840\",\"name\":\"Amy Li\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 686, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:35.431Z", + "time": 144 + }, + { + "_id": "76efebf6d204c8e85a8cbd11c0a4ae43", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 175, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\"]},\"relationships\":{\"sink_org\":{\"data\":{\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"type\":\"orgs\"}}},\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections" + }, + "response": { + "bodySize": 131, + "content": { + "mimeType": "application/json", + "size": 131, + "text": "{\"errors\":[\"connection between orgs 4dee724d-00cc-11ea-a77b-570c9d03c6c5 and 83999dcd-7f97-11f0-8de1-1ecf66f1aa85 already exists\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 686, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 409, + "statusText": "Conflict" + }, + "startedDateTime": "2025-08-26T20:19:35.581Z", + "time": 143 + }, + { + "_id": "de32e8df4f044ebdaf9bc2a872bbd00c", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 543, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/b5d3a360-d6e2-4af7-8da2-b2ff41b9f5e0" + }, + "response": { + "bodySize": 3, + "content": { + "mimeType": "application/json", + "size": 3, + "text": "{}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 661, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:35.729Z", + "time": 182 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Not-Found-response_1760104000/frozen.json b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Not-Found-response_1760104000/frozen.json new file mode 100644 index 000000000000..cee9f189ee99 --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Not-Found-response_1760104000/frozen.json @@ -0,0 +1 @@ +"2025-08-26T20:19:35.916Z" diff --git a/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Not-Found-response_1760104000/recording.har b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Not-Found-response_1760104000/recording.har new file mode 100644 index 000000000000..5d31e19df466 --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-Not-Found-response_1760104000/recording.har @@ -0,0 +1,67 @@ +{ + "log": { + "_recordingName": "Org Connections/Create Org Connection returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "7f0e9dad6b89fbf40ba61c6424be2da7", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 157, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\"]},\"relationships\":{\"sink_org\":{\"data\":{\"id\":\"nonexistent-org-id\",\"type\":\"orgs\"}}},\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections" + }, + "response": { + "bodySize": 25, + "content": { + "mimeType": "application/json", + "size": 25, + "text": "{\"errors\":[\"Not found\"]}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 662, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-08-26T20:19:35.919Z", + "time": 122 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-OK-response_1410740483/frozen.json b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-OK-response_1410740483/frozen.json new file mode 100644 index 000000000000..9061967ca32f --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-OK-response_1410740483/frozen.json @@ -0,0 +1 @@ +"2025-08-26T20:19:36.045Z" diff --git a/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-OK-response_1410740483/recording.har b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-OK-response_1410740483/recording.har new file mode 100644 index 000000000000..d1c75744eb32 --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Create-Org-Connection-returns-OK-response_1410740483/recording.har @@ -0,0 +1,110 @@ +{ + "log": { + "_recordingName": "Org Connections/Create Org Connection returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "76efebf6d204c8e85a8cbd11c0a4ae43", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 175, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\"]},\"relationships\":{\"sink_org\":{\"data\":{\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"type\":\"orgs\"}}},\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections" + }, + "response": { + "bodySize": 520, + "content": { + "mimeType": "application/json", + "size": 520, + "text": "{\"data\":{\"type\":\"org_connection\",\"id\":\"40bbb1c2-32b2-4aa3-8a1a-5d93b5382e3d\",\"attributes\":{\"created_at\":\"2025-08-26T20:19:36.177236+00:00\",\"connection_types\":[\"logs\"]},\"relationships\":{\"source_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\",\"name\":\"DD Integration Tests (321813)\"}},\"sink_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"name\":\"Cross-Org BDD Test Org\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"03e6bc43-7ecc-11f0-b50b-f28f2be41840\",\"name\":\"Amy Li\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 686, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:36.047Z", + "time": 148 + }, + { + "_id": "36e827dff44d23a27b433c55baf1e36b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 543, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/40bbb1c2-32b2-4aa3-8a1a-5d93b5382e3d" + }, + "response": { + "bodySize": 3, + "content": { + "mimeType": "application/json", + "size": 3, + "text": "{}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 661, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:36.200Z", + "time": 160 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Bad-Request-response_2749209244/frozen.json b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Bad-Request-response_2749209244/frozen.json new file mode 100644 index 000000000000..e3defd56059d --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Bad-Request-response_2749209244/frozen.json @@ -0,0 +1 @@ +"2025-08-26T20:19:36.363Z" diff --git a/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Bad-Request-response_2749209244/recording.har b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Bad-Request-response_2749209244/recording.har new file mode 100644 index 000000000000..b50760b43f34 --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Bad-Request-response_2749209244/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Org Connections/Delete Org Connection returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "c5bc887fe392d215235718b29cbb258f", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 519, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/malformed_id" + }, + "response": { + "bodySize": 49, + "content": { + "mimeType": "application/json", + "size": 49, + "text": "{\"errors\":[\"connection id must be a valid uuid\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 685, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-08-26T20:19:36.367Z", + "time": 111 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Not-Found-response_1076827547/frozen.json b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Not-Found-response_1076827547/frozen.json new file mode 100644 index 000000000000..4e77bfbdee92 --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Not-Found-response_1076827547/frozen.json @@ -0,0 +1 @@ +"2025-08-26T20:19:36.481Z" diff --git a/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Not-Found-response_1076827547/recording.har b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Not-Found-response_1076827547/recording.har new file mode 100644 index 000000000000..606884f92a8e --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-Not-Found-response_1076827547/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Org Connections/Delete Org Connection returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "93d952468c03e9f43cfa4183413e3c46", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 543, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/00000000-0000-0000-0000-000000000000" + }, + "response": { + "bodySize": 94, + "content": { + "mimeType": "application/json", + "size": 94, + "text": "{\"errors\":[\"org connection with id:00000000-0000-0000-0000-000000000000 not found not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 685, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-08-26T20:19:36.482Z", + "time": 130 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-OK-response_2943596482/frozen.json b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-OK-response_2943596482/frozen.json new file mode 100644 index 000000000000..072001e83760 --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-OK-response_2943596482/frozen.json @@ -0,0 +1 @@ +"2025-08-26T20:19:36.615Z" diff --git a/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-OK-response_2943596482/recording.har b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-OK-response_2943596482/recording.har new file mode 100644 index 000000000000..4ac722c545c7 --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Delete-Org-Connection-returns-OK-response_2943596482/recording.har @@ -0,0 +1,153 @@ +{ + "log": { + "_recordingName": "Org Connections/Delete Org Connection returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "76efebf6d204c8e85a8cbd11c0a4ae43", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 175, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\"]},\"relationships\":{\"sink_org\":{\"data\":{\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"type\":\"orgs\"}}},\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections" + }, + "response": { + "bodySize": 520, + "content": { + "mimeType": "application/json", + "size": 520, + "text": "{\"data\":{\"type\":\"org_connection\",\"id\":\"7b01f30c-6100-4cbf-b583-a5e353d7edb7\",\"attributes\":{\"created_at\":\"2025-08-26T20:19:36.737560+00:00\",\"connection_types\":[\"logs\"]},\"relationships\":{\"source_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\",\"name\":\"DD Integration Tests (321813)\"}},\"sink_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"name\":\"Cross-Org BDD Test Org\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"03e6bc43-7ecc-11f0-b50b-f28f2be41840\",\"name\":\"Amy Li\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 686, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:36.617Z", + "time": 139 + }, + { + "_id": "3341cd1bc3fff5e25bafe8947a2ea52d", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 543, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/7b01f30c-6100-4cbf-b583-a5e353d7edb7" + }, + "response": { + "bodySize": 3, + "content": { + "mimeType": "application/json", + "size": 3, + "text": "{}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 661, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:36.765Z", + "time": 184 + }, + { + "_id": "3341cd1bc3fff5e25bafe8947a2ea52d", + "_order": 1, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 543, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/7b01f30c-6100-4cbf-b583-a5e353d7edb7" + }, + "response": { + "bodySize": 94, + "content": { + "mimeType": "application/json", + "size": 94, + "text": "{\"errors\":[\"org connection with id:7b01f30c-6100-4cbf-b583-a5e353d7edb7 not found not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 685, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-08-26T20:19:36.955Z", + "time": 126 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Org-Connections_1174763688/List-Org-Connections-returns-OK-response_1051001000/frozen.json b/cassettes/v2/Org-Connections_1174763688/List-Org-Connections-returns-OK-response_1051001000/frozen.json new file mode 100644 index 000000000000..03ac96cfb6c1 --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/List-Org-Connections-returns-OK-response_1051001000/frozen.json @@ -0,0 +1 @@ +"2025-08-26T20:19:37.084Z" diff --git a/cassettes/v2/Org-Connections_1174763688/List-Org-Connections-returns-OK-response_1051001000/recording.har b/cassettes/v2/Org-Connections_1174763688/List-Org-Connections-returns-OK-response_1051001000/recording.har new file mode 100644 index 000000000000..7a840881964c --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/List-Org-Connections-returns-OK-response_1051001000/recording.har @@ -0,0 +1,57 @@ +{ + "log": { + "_recordingName": "Org Connections/List Org Connections returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "c4a45f022843cd721bba31dac1a31203", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + } + ], + "headersSize": 514, + "httpVersion": "HTTP/1.1", + "method": "GET", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections" + }, + "response": { + "bodySize": 71, + "content": { + "mimeType": "application/json", + "size": 71, + "text": "{\"data\":[],\"meta\":{\"page\":{\"total_count\":0,\"total_filtered_count\":0}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 682, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:37.084Z", + "time": 124 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Bad-Request-response_1023592838/frozen.json b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Bad-Request-response_1023592838/frozen.json new file mode 100644 index 000000000000..cf1800f1a84d --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Bad-Request-response_1023592838/frozen.json @@ -0,0 +1 @@ +"2025-08-26T20:19:37.212Z" diff --git a/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Bad-Request-response_1023592838/recording.har b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Bad-Request-response_1023592838/recording.har new file mode 100644 index 000000000000..3034ca8bed1f --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Bad-Request-response_1023592838/recording.har @@ -0,0 +1,163 @@ +{ + "log": { + "_recordingName": "Org Connections/Update Org Connection returns \"Bad Request\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "76efebf6d204c8e85a8cbd11c0a4ae43", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 175, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\"]},\"relationships\":{\"sink_org\":{\"data\":{\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"type\":\"orgs\"}}},\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections" + }, + "response": { + "bodySize": 520, + "content": { + "mimeType": "application/json", + "size": 520, + "text": "{\"data\":{\"type\":\"org_connection\",\"id\":\"76e1a71f-81e5-40c8-b8e0-1b98265d26fe\",\"attributes\":{\"created_at\":\"2025-08-26T20:19:37.335819+00:00\",\"connection_types\":[\"logs\"]},\"relationships\":{\"source_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\",\"name\":\"DD Integration Tests (321813)\"}},\"sink_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"name\":\"Cross-Org BDD Test Org\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"03e6bc43-7ecc-11f0-b50b-f28f2be41840\",\"name\":\"Amy Li\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 686, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:37.214Z", + "time": 142 + }, + { + "_id": "0baa85f57971d9e273f4a6740ce0eb1b", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 128, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 608, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\",\"logs\"]},\"id\":\"76e1a71f-81e5-40c8-b8e0-1b98265d26fe\",\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/76e1a71f-81e5-40c8-b8e0-1b98265d26fe" + }, + "response": { + "bodySize": 43, + "content": { + "mimeType": "application/json", + "size": 43, + "text": "{\"errors\":[\"Validation failed for input.\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 685, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 400, + "statusText": "Bad Request" + }, + "startedDateTime": "2025-08-26T20:19:37.365Z", + "time": 121 + }, + { + "_id": "d129ad25cb8db0d8b518ebfda109c597", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 543, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/76e1a71f-81e5-40c8-b8e0-1b98265d26fe" + }, + "response": { + "bodySize": 3, + "content": { + "mimeType": "application/json", + "size": 3, + "text": "{}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 661, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:37.492Z", + "time": 113 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Not-Found-response_1519971277/frozen.json b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Not-Found-response_1519971277/frozen.json new file mode 100644 index 000000000000..91c4c8c23f35 --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Not-Found-response_1519971277/frozen.json @@ -0,0 +1 @@ +"2025-08-26T20:19:37.609Z" diff --git a/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Not-Found-response_1519971277/recording.har b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Not-Found-response_1519971277/recording.har new file mode 100644 index 000000000000..9d6ee541272c --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-Not-Found-response_1519971277/recording.har @@ -0,0 +1,163 @@ +{ + "log": { + "_recordingName": "Org Connections/Update Org Connection returns \"Not Found\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "76efebf6d204c8e85a8cbd11c0a4ae43", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 175, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\"]},\"relationships\":{\"sink_org\":{\"data\":{\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"type\":\"orgs\"}}},\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections" + }, + "response": { + "bodySize": 520, + "content": { + "mimeType": "application/json", + "size": 520, + "text": "{\"data\":{\"type\":\"org_connection\",\"id\":\"d348b9ab-c7cf-4298-83a6-b4762fafff5e\",\"attributes\":{\"created_at\":\"2025-08-26T20:19:37.737812+00:00\",\"connection_types\":[\"logs\"]},\"relationships\":{\"source_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\",\"name\":\"DD Integration Tests (321813)\"}},\"sink_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"name\":\"Cross-Org BDD Test Org\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"03e6bc43-7ecc-11f0-b50b-f28f2be41840\",\"name\":\"Amy Li\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 686, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:37.611Z", + "time": 212 + }, + { + "_id": "ee8cf63c256668781e6da82afed6dc44", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 608, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\",\"metrics\"]},\"id\":\"00000000-0000-0000-0000-000000000000\",\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/00000000-0000-0000-0000-000000000000" + }, + "response": { + "bodySize": 94, + "content": { + "mimeType": "application/json", + "size": 94, + "text": "{\"errors\":[\"Org connection with id:00000000-0000-0000-0000-000000000000 not found not found\"]}" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 685, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 404, + "statusText": "Not Found" + }, + "startedDateTime": "2025-08-26T20:19:37.827Z", + "time": 133 + }, + { + "_id": "3ea3241b03418f98437debf025dea747", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 543, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/d348b9ab-c7cf-4298-83a6-b4762fafff5e" + }, + "response": { + "bodySize": 3, + "content": { + "mimeType": "application/json", + "size": 3, + "text": "{}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 661, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:37.964Z", + "time": 121 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-OK-response_3589373708/frozen.json b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-OK-response_3589373708/frozen.json new file mode 100644 index 000000000000..83f45b6632fd --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-OK-response_3589373708/frozen.json @@ -0,0 +1 @@ +"2025-08-26T20:19:38.089Z" diff --git a/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-OK-response_3589373708/recording.har b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-OK-response_3589373708/recording.har new file mode 100644 index 000000000000..476e9584f64f --- /dev/null +++ b/cassettes/v2/Org-Connections_1174763688/Update-Org-Connection-returns-OK-response_3589373708/recording.har @@ -0,0 +1,163 @@ +{ + "log": { + "_recordingName": "Org Connections/Update Org Connection returns \"OK\" response", + "creator": { + "comment": "persister:fs", + "name": "Polly.JS", + "version": "6.0.5" + }, + "entries": [ + { + "_id": "76efebf6d204c8e85a8cbd11c0a4ae43", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 175, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 570, + "httpVersion": "HTTP/1.1", + "method": "POST", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\"]},\"relationships\":{\"sink_org\":{\"data\":{\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"type\":\"orgs\"}}},\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections" + }, + "response": { + "bodySize": 520, + "content": { + "mimeType": "application/json", + "size": 520, + "text": "{\"data\":{\"type\":\"org_connection\",\"id\":\"0105233a-4d7b-4c52-b364-cc968d003de0\",\"attributes\":{\"created_at\":\"2025-08-26T20:19:38.208326+00:00\",\"connection_types\":[\"logs\"]},\"relationships\":{\"source_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\",\"name\":\"DD Integration Tests (321813)\"}},\"sink_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\",\"name\":\"Cross-Org BDD Test Org\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"03e6bc43-7ecc-11f0-b50b-f28f2be41840\",\"name\":\"Amy Li\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 686, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:38.091Z", + "time": 141 + }, + { + "_id": "d9e0b64c3bbeb3f7093c6afc4436a1b0", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 131, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "application/json" + }, + { + "_fromType": "array", + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 608, + "httpVersion": "HTTP/1.1", + "method": "PATCH", + "postData": { + "mimeType": "application/json", + "params": [], + "text": "{\"data\":{\"attributes\":{\"connection_types\":[\"logs\",\"metrics\"]},\"id\":\"0105233a-4d7b-4c52-b364-cc968d003de0\",\"type\":\"org_connection\"}}" + }, + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/0105233a-4d7b-4c52-b364-cc968d003de0" + }, + "response": { + "bodySize": 443, + "content": { + "mimeType": "application/json", + "size": 443, + "text": "{\"data\":{\"type\":\"org_connection\",\"id\":\"0105233a-4d7b-4c52-b364-cc968d003de0\",\"attributes\":{\"created_at\":\"2025-08-26T20:19:38.208326+00:00\",\"connection_types\":[\"logs\",\"metrics\"]},\"relationships\":{\"source_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}},\"sink_org\":{\"data\":{\"type\":\"orgs\",\"id\":\"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"03e6bc43-7ecc-11f0-b50b-f28f2be41840\"}}}}}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 686, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:38.238Z", + "time": 127 + }, + { + "_id": "0d265c589ea2653b134adcc39dc45e4a", + "_order": 0, + "cache": {}, + "request": { + "bodySize": 0, + "cookies": [], + "headers": [ + { + "_fromType": "array", + "name": "accept", + "value": "*/*" + } + ], + "headersSize": 543, + "httpVersion": "HTTP/1.1", + "method": "DELETE", + "queryString": [], + "url": "https://api.datadoghq.com/api/v2/org_connections/0105233a-4d7b-4c52-b364-cc968d003de0" + }, + "response": { + "bodySize": 3, + "content": { + "mimeType": "application/json", + "size": 3, + "text": "{}\n" + }, + "cookies": [], + "headers": [ + { + "name": "content-type", + "value": "application/json" + } + ], + "headersSize": 661, + "httpVersion": "HTTP/1.1", + "redirectURL": "", + "status": 200, + "statusText": "OK" + }, + "startedDateTime": "2025-08-26T20:19:38.370Z", + "time": 119 + } + ], + "pages": [], + "version": "1.2" + } +} diff --git a/features/v2/given.json b/features/v2/given.json index b6097093658a..1f3f28211f8f 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -549,6 +549,19 @@ "tag": "On-Call", "operationId": "SetOnCallTeamRoutingRules" }, + { + "parameters": [ + { + "name": "body", + "origin": "request", + "value": "{\n \"data\": {\n \"type\": \"org_connection\",\n \"relationships\": {\n \"sink_org\": {\n \"data\": {\n \"type\": \"orgs\",\n \"id\": \"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\"\n }\n }\n },\n \"attributes\": {\n \"connection_types\": [\"logs\"]\n }\n }\n}" + } + ], + "step": "there is a valid \"org_connection\" in the system", + "key": "org_connection", + "tag": "Org Connections", + "operationId": "CreateOrgConnections" + }, { "source": "data[4]", "step": "there is a valid \"permission\" in the system", diff --git a/features/v2/org_connections.feature b/features/v2/org_connections.feature new file mode 100644 index 000000000000..321e7c77f24c --- /dev/null +++ b/features/v2/org_connections.feature @@ -0,0 +1,95 @@ +@endpoint(org-connections) @endpoint(org-connections-v2) +Feature: Org Connections + Manage connections between organizations. Org connections allow for + controlled sharing of data between different Datadog organizations. See + the [Cross-Organization Visibiltiy](https://docs.datadoghq.com/account_man + agement/org_settings/cross_org_visibility/) page for more information. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "OrgConnections" API + + @team:DataDog/aaa-granular-access + Scenario: Create Org Connection returns "Bad Request" response + Given new "CreateOrgConnections" request + And body with value {"data": {"type": "org_connection", "relationships": {"sink_org": {"data": {"type": "orgs", "id": "83999dcd-7f97-11f0-8de1-1ecf66f1aa85"}}}, "attributes": {"connection_types": ["logs", "logs"]}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aaa-granular-access + Scenario: Create Org Connection returns "Conflict" response + Given there is a valid "org_connection" in the system + And new "CreateOrgConnections" request + And body with value {"data": {"type": "org_connection", "relationships": {"sink_org": {"data": {"type": "orgs", "id": "83999dcd-7f97-11f0-8de1-1ecf66f1aa85"}}}, "attributes": {"connection_types": ["logs"]}}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/aaa-granular-access + Scenario: Create Org Connection returns "Not Found" response + Given new "CreateOrgConnections" request + And body with value {"data": {"type": "org_connection", "relationships": {"sink_org": {"data": {"type": "orgs", "id": "nonexistent-org-id"}}}, "attributes": {"connection_types": ["logs"]}}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/aaa-granular-access + Scenario: Create Org Connection returns "OK" response + Given new "CreateOrgConnections" request + And body with value {"data": {"type": "org_connection", "relationships": {"sink_org": {"data": {"type": "orgs", "id": "83999dcd-7f97-11f0-8de1-1ecf66f1aa85"}}}, "attributes": {"connection_types": ["logs"]}}} + When the request is sent + Then the response status is 200 Created + + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/aaa-granular-access + Scenario: Delete Org Connection returns "Bad Request" response + Given new "DeleteOrgConnections" request + And request contains "connection_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aaa-granular-access + Scenario: Delete Org Connection returns "Not Found" response + Given new "DeleteOrgConnections" request + And request contains "connection_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/aaa-granular-access + Scenario: Delete Org Connection returns "OK" response + Given there is a valid "org_connection" in the system + And new "DeleteOrgConnections" request + And request contains "connection_id" parameter from "org_connection.data.id" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/aaa-granular-access + Scenario: List Org Connections returns "OK" response + Given new "ListOrgConnections" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/aaa-granular-access + Scenario: Update Org Connection returns "Bad Request" response + Given there is a valid "org_connection" in the system + And new "UpdateOrgConnections" request + And request contains "connection_id" parameter from "org_connection.data.id" + And body with value {"data": {"type": "org_connection", "id": "{{ org_connection.data.id }}", "attributes": {"connection_types": ["logs", "logs"]}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aaa-granular-access + Scenario: Update Org Connection returns "Not Found" response + Given there is a valid "org_connection" in the system + And new "UpdateOrgConnections" request + And request contains "connection_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"type": "org_connection", "id": "00000000-0000-0000-0000-000000000000", "attributes": {"connection_types": ["logs", "metrics"]}}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/aaa-granular-access + Scenario: Update Org Connection returns "OK" response + Given there is a valid "org_connection" in the system + And new "UpdateOrgConnections" request + And request contains "connection_id" parameter from "org_connection.data.id" + And body with value {"data": {"type": "org_connection", "id": "{{ org_connection.data.id }}", "attributes": {"connection_types": ["logs", "metrics"]}}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 9878d7a46785..922ff9a2a045 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2222,6 +2222,37 @@ "type": "idempotent" } }, + "ListOrgConnections": { + "tag": "Org Connections", + "undo": { + "type": "safe" + } + }, + "CreateOrgConnections": { + "tag": "Org Connections", + "undo": { + "operationId": "DeleteOrgConnections", + "parameters": [ + { + "name": "connection_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteOrgConnections": { + "tag": "Org Connections", + "undo": { + "type": "idempotent" + } + }, + "UpdateOrgConnections": { + "tag": "Org Connections", + "undo": { + "type": "idempotent" + } + }, "ListPermissions": { "tag": "Roles", "undo": { diff --git a/packages/datadog-api-client/README.md b/packages/datadog-api-client/README.md index 2d5dc09f45c4..7a2e72ca0ecf 100644 --- a/packages/datadog-api-client/README.md +++ b/packages/datadog-api-client/README.md @@ -403,6 +403,7 @@ apiInstance | On-Call | @datadog/datadog-api-client-on-call | [README.md](../../services/on-call/README.md) | | On-Call Paging | @datadog/datadog-api-client-on-call-paging | [README.md](../../services/on-call-paging/README.md) | | Opsgenie Integration | @datadog/datadog-api-client-opsgenie-integration | [README.md](../../services/opsgenie-integration/README.md) | +| Org Connections | @datadog/datadog-api-client-org-connections | [README.md](../../services/org-connections/README.md) | | Organizations | @datadog/datadog-api-client-organizations | [README.md](../../services/organizations/README.md) | | PagerDuty Integration | @datadog/datadog-api-client-pager-duty-integration | [README.md](../../services/pager-duty-integration/README.md) | | Powerpack | @datadog/datadog-api-client-powerpack | [README.md](../../services/powerpack/README.md) | diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index f3029488d450..3b97b8245c02 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -6419,6 +6419,34 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "{}", }, + "OrgConnectionsApi.V2.ListOrgConnections": { + operationResponseType: "OrgConnectionListResponse", + }, + "OrgConnectionsApi.V2.CreateOrgConnections": { + body: { + type: "OrgConnectionCreateRequest", + format: "", + }, + operationResponseType: "OrgConnectionResponse", + }, + "OrgConnectionsApi.V2.DeleteOrgConnections": { + connectionId: { + type: "string", + format: "uuid", + }, + operationResponseType: "{}", + }, + "OrgConnectionsApi.V2.UpdateOrgConnections": { + connectionId: { + type: "string", + format: "uuid", + }, + body: { + type: "OrgConnectionUpdateRequest", + format: "", + }, + operationResponseType: "OrgConnectionResponse", + }, "RolesApi.V2.ListPermissions": { operationResponseType: "PermissionsResponse", }, diff --git a/services/org_connections/.yarnrc.yml b/services/org_connections/.yarnrc.yml new file mode 100644 index 000000000000..3186f3f0795a --- /dev/null +++ b/services/org_connections/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/services/org_connections/README.md b/services/org_connections/README.md new file mode 100644 index 000000000000..7786d251d2bd --- /dev/null +++ b/services/org_connections/README.md @@ -0,0 +1,35 @@ +# @datadog/datadog-api-client-org-connections + +## Description + +Manage connections between organizations. Org connections allow for controlled sharing of data between different Datadog organizations. See the [Cross-Organization Visibiltiy](https://docs.datadoghq.com/account_management/org_settings/cross_org_visibility/) page for more information. + +## Navigation + +- [Installation](#installation) +- [Getting Started](#getting-started) + +## Installation + +```sh +# NPM +npm install @datadog/datadog-api-client-org-connections +# Yarn +yarn add @datadog/datadog-api-client-org-connections +``` + +## Getting Started +```ts +import { createConfiguration } from "@datadog/datadog-api-client"; +import { OrgConnectionsApiV2 } from "@datadog/datadog-api-client-org-connections"; +import { v2 } from "@datadog/datadog-api-client-org-connections"; + +const configuration = createConfiguration(); +const apiInstance = new OrgConnectionsApiV2(configuration); + +apiInstance.listOrgConnections().then((data) => { + console.log("API called successfully. Returned data: " + JSON.stringify(data)); +}).catch((error) => { + console.error("Error calling API: " + error); +}); +``` \ No newline at end of file diff --git a/services/org_connections/package.json b/services/org_connections/package.json new file mode 100644 index 000000000000..6af7afe843e7 --- /dev/null +++ b/services/org_connections/package.json @@ -0,0 +1,43 @@ +{ + "name": "@datadog/datadog-api-client-org-connections", + "description": "", + "author": "", + "keywords": [ + "api", + "fetch", + "typescript" + ], + "license": "Apache-2.0", + "licenses": [ + { + "type": "Apache-2.0", + "url": "http://www.apache.org/licenses/LICENSE-2.0" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/DataDog/datadog-api-client-typescript.git", + "directory": "services/org-connections" + }, + "files": [ + "dist/**/*" + ], + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "scripts": { + "prepack": "yarn workspace @datadog/datadog-api-client build && yarn build", + "build": "yarn generate-version-files && tsc", + "generate-version-files": "node -p \"'export const version = ' + JSON.stringify(require('./package.json').version)\" > src/version.ts" + }, + "dependencies": { + "@datadog/datadog-api-client": "^2.0.0-beta.0" + }, + "devDependencies": { + "typescript": "5.8.3" + }, + "engines": { + "node": ">=18.0.0" + }, + "version": "0.0.1", + "packageManager": "yarn@4.9.1" +} diff --git a/services/org_connections/src/index.ts b/services/org_connections/src/index.ts new file mode 100644 index 000000000000..2d46e56b7a7f --- /dev/null +++ b/services/org_connections/src/index.ts @@ -0,0 +1,3 @@ +export * as v2 from "./v2"; + +export { OrgConnectionsApi as OrgConnectionsApiV2 } from "./v2/OrgConnectionsApi"; diff --git a/services/org_connections/src/v2/OrgConnectionsApi.ts b/services/org_connections/src/v2/OrgConnectionsApi.ts new file mode 100644 index 000000000000..ac52cde8c785 --- /dev/null +++ b/services/org_connections/src/v2/OrgConnectionsApi.ts @@ -0,0 +1,597 @@ +import { + ApiException, + BaseAPIRequestFactory, + BaseServerConfiguration, + buildUserAgent, + Configuration, + createConfiguration, + deserialize, + getPreferredMediaType, + HttpMethod, + isBrowser, + logger, + normalizeMediaType, + parse, + RequiredError, + RequestContext, + ResponseContext, + serialize, + ServerConfiguration, + stringify, + applySecurityAuthentication, +} from "@datadog/datadog-api-client"; + +import { TypingInfo } from "./models/TypingInfo"; +import { APIErrorResponse } from "./models/APIErrorResponse"; +import { OrgConnectionCreateRequest } from "./models/OrgConnectionCreateRequest"; +import { OrgConnectionListResponse } from "./models/OrgConnectionListResponse"; +import { OrgConnectionResponse } from "./models/OrgConnectionResponse"; +import { OrgConnectionUpdateRequest } from "./models/OrgConnectionUpdateRequest"; +import { version } from "../version"; + +export class OrgConnectionsApiRequestFactory extends BaseAPIRequestFactory { + public userAgent: string | undefined; + + public constructor(configuration: Configuration) { + super(configuration); + if (!isBrowser) { + this.userAgent = buildUserAgent("org-connections", version); + } + } + public async createOrgConnections( + body: OrgConnectionCreateRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createOrgConnections"); + } + + // Path Params + const localVarPath = "/api/v2/org_connections"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "OrgConnectionsApi.v2.createOrgConnections", + OrgConnectionsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "OrgConnectionCreateRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async deleteOrgConnections( + connectionId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'connectionId' is not null or undefined + if (connectionId === null || connectionId === undefined) { + throw new RequiredError("connectionId", "deleteOrgConnections"); + } + + // Path Params + const localVarPath = "/api/v2/org_connections/{connection_id}".replace( + "{connection_id}", + encodeURIComponent(String(connectionId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "OrgConnectionsApi.v2.deleteOrgConnections", + OrgConnectionsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.DELETE, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async listOrgConnections( + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/org_connections"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "OrgConnectionsApi.v2.listOrgConnections", + OrgConnectionsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async updateOrgConnections( + connectionId: string, + body: OrgConnectionUpdateRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'connectionId' is not null or undefined + if (connectionId === null || connectionId === undefined) { + throw new RequiredError("connectionId", "updateOrgConnections"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateOrgConnections"); + } + + // Path Params + const localVarPath = "/api/v2/org_connections/{connection_id}".replace( + "{connection_id}", + encodeURIComponent(String(connectionId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "OrgConnectionsApi.v2.updateOrgConnections", + OrgConnectionsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.PATCH, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "OrgConnectionUpdateRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } +} + +export class OrgConnectionsApiResponseProcessor { + /** + * 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 createOrgConnections + * @throws ApiException if the response code was not in [200, 299] + */ + public async createOrgConnections( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: OrgConnectionResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OrgConnectionResponse", + ) as OrgConnectionResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 409 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: OrgConnectionResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OrgConnectionResponse", + "", + ) as OrgConnectionResponse; + 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 + * + * @params response Response returned by the server for a request to deleteOrgConnections + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteOrgConnections(response: ResponseContext): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + 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 + * + * @params response Response returned by the server for a request to listOrgConnections + * @throws ApiException if the response code was not in [200, 299] + */ + public async listOrgConnections( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: OrgConnectionListResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OrgConnectionListResponse", + ) as OrgConnectionListResponse; + return body; + } + if ( + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: OrgConnectionListResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OrgConnectionListResponse", + "", + ) as OrgConnectionListResponse; + 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 + * + * @params response Response returned by the server for a request to updateOrgConnections + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateOrgConnections( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: OrgConnectionResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OrgConnectionResponse", + ) as OrgConnectionResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 401 || + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: OrgConnectionResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OrgConnectionResponse", + "", + ) as OrgConnectionResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface OrgConnectionsApiCreateOrgConnectionsRequest { + /** + * @type OrgConnectionCreateRequest + */ + body: OrgConnectionCreateRequest; +} + +export interface OrgConnectionsApiDeleteOrgConnectionsRequest { + /** + * The unique identifier of the org connection. + * @type string + */ + connectionId: string; +} + +export interface OrgConnectionsApiUpdateOrgConnectionsRequest { + /** + * The unique identifier of the org connection. + * @type string + */ + connectionId: string; + /** + * @type OrgConnectionUpdateRequest + */ + body: OrgConnectionUpdateRequest; +} + +export class OrgConnectionsApi { + private requestFactory: OrgConnectionsApiRequestFactory; + private responseProcessor: OrgConnectionsApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: OrgConnectionsApiRequestFactory, + responseProcessor?: OrgConnectionsApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); + this.requestFactory = + requestFactory || new OrgConnectionsApiRequestFactory(this.configuration); + this.responseProcessor = + responseProcessor || new OrgConnectionsApiResponseProcessor(); + } + + /** + * Create a new org connection between the current org and a target org. + * @param param The request object + */ + public createOrgConnections( + param: OrgConnectionsApiCreateOrgConnectionsRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.createOrgConnections( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createOrgConnections(responseContext); + }); + }); + } + + /** + * Delete an existing org connection. + * @param param The request object + */ + public deleteOrgConnections( + param: OrgConnectionsApiDeleteOrgConnectionsRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.deleteOrgConnections( + param.connectionId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteOrgConnections(responseContext); + }); + }); + } + + /** + * Returns a list of org connections. + * @param param The request object + */ + public listOrgConnections( + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.listOrgConnections(options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listOrgConnections(responseContext); + }); + }); + } + + /** + * Update an existing org connection. + * @param param The request object + */ + public updateOrgConnections( + param: OrgConnectionsApiUpdateOrgConnectionsRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.updateOrgConnections( + param.connectionId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateOrgConnections(responseContext); + }); + }); + } +} diff --git a/services/org_connections/src/v2/index.ts b/services/org_connections/src/v2/index.ts new file mode 100644 index 000000000000..96735d18ad8e --- /dev/null +++ b/services/org_connections/src/v2/index.ts @@ -0,0 +1,30 @@ +export { + OrgConnectionsApiCreateOrgConnectionsRequest, + OrgConnectionsApiDeleteOrgConnectionsRequest, + OrgConnectionsApiUpdateOrgConnectionsRequest, + OrgConnectionsApi, +} from "./OrgConnectionsApi"; + +export { APIErrorResponse } from "./models/APIErrorResponse"; +export { OrgConnection } from "./models/OrgConnection"; +export { OrgConnectionAttributes } from "./models/OrgConnectionAttributes"; +export { OrgConnectionCreate } from "./models/OrgConnectionCreate"; +export { OrgConnectionCreateAttributes } from "./models/OrgConnectionCreateAttributes"; +export { OrgConnectionCreateRelationships } from "./models/OrgConnectionCreateRelationships"; +export { OrgConnectionCreateRequest } from "./models/OrgConnectionCreateRequest"; +export { OrgConnectionListResponse } from "./models/OrgConnectionListResponse"; +export { OrgConnectionListResponseMeta } from "./models/OrgConnectionListResponseMeta"; +export { OrgConnectionListResponseMetaPage } from "./models/OrgConnectionListResponseMetaPage"; +export { OrgConnectionOrgRelationship } from "./models/OrgConnectionOrgRelationship"; +export { OrgConnectionOrgRelationshipData } from "./models/OrgConnectionOrgRelationshipData"; +export { OrgConnectionOrgRelationshipDataType } from "./models/OrgConnectionOrgRelationshipDataType"; +export { OrgConnectionRelationships } from "./models/OrgConnectionRelationships"; +export { OrgConnectionResponse } from "./models/OrgConnectionResponse"; +export { OrgConnectionType } from "./models/OrgConnectionType"; +export { OrgConnectionTypeEnum } from "./models/OrgConnectionTypeEnum"; +export { OrgConnectionUpdate } from "./models/OrgConnectionUpdate"; +export { OrgConnectionUpdateAttributes } from "./models/OrgConnectionUpdateAttributes"; +export { OrgConnectionUpdateRequest } from "./models/OrgConnectionUpdateRequest"; +export { OrgConnectionUserRelationship } from "./models/OrgConnectionUserRelationship"; +export { OrgConnectionUserRelationshipData } from "./models/OrgConnectionUserRelationshipData"; +export { OrgConnectionUserRelationshipDataType } from "./models/OrgConnectionUserRelationshipDataType"; diff --git a/services/org_connections/src/v2/models/APIErrorResponse.ts b/services/org_connections/src/v2/models/APIErrorResponse.ts new file mode 100644 index 000000000000..58d6c35b80f0 --- /dev/null +++ b/services/org_connections/src/v2/models/APIErrorResponse.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * API error response. + */ +export class APIErrorResponse { + /** + * A list of errors. + */ + "errors": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + errors: { + baseName: "errors", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return APIErrorResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnection.ts b/services/org_connections/src/v2/models/OrgConnection.ts new file mode 100644 index 000000000000..612073d8f7d0 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnection.ts @@ -0,0 +1,77 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionAttributes } from "./OrgConnectionAttributes"; +import { OrgConnectionRelationships } from "./OrgConnectionRelationships"; +import { OrgConnectionType } from "./OrgConnectionType"; + +/** + * An org connection. + */ +export class OrgConnection { + /** + * Org connection attributes. + */ + "attributes": OrgConnectionAttributes; + /** + * The unique identifier of the org connection. + */ + "id": string; + /** + * Related organizations and user. + */ + "relationships": OrgConnectionRelationships; + /** + * Org connection type. + */ + "type": OrgConnectionType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "OrgConnectionAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + relationships: { + baseName: "relationships", + type: "OrgConnectionRelationships", + required: true, + }, + type: { + baseName: "type", + type: "OrgConnectionType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnection.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionAttributes.ts b/services/org_connections/src/v2/models/OrgConnectionAttributes.ts new file mode 100644 index 000000000000..3be670c0458b --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionAttributes.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionTypeEnum } from "./OrgConnectionTypeEnum"; + +/** + * Org connection attributes. + */ +export class OrgConnectionAttributes { + /** + * List of connection types. + */ + "connectionTypes": Array; + /** + * Timestamp when the connection was created. + */ + "createdAt": Date; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + connectionTypes: { + baseName: "connection_types", + type: "Array", + required: true, + }, + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionCreate.ts b/services/org_connections/src/v2/models/OrgConnectionCreate.ts new file mode 100644 index 000000000000..89f638d4ae17 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionCreate.ts @@ -0,0 +1,67 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionCreateAttributes } from "./OrgConnectionCreateAttributes"; +import { OrgConnectionCreateRelationships } from "./OrgConnectionCreateRelationships"; +import { OrgConnectionType } from "./OrgConnectionType"; + +/** + * Org connection creation data. + */ +export class OrgConnectionCreate { + /** + * Attributes for creating an org connection. + */ + "attributes": OrgConnectionCreateAttributes; + /** + * Relationships for org connection creation. + */ + "relationships": OrgConnectionCreateRelationships; + /** + * Org connection type. + */ + "type": OrgConnectionType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "OrgConnectionCreateAttributes", + required: true, + }, + relationships: { + baseName: "relationships", + type: "OrgConnectionCreateRelationships", + required: true, + }, + type: { + baseName: "type", + type: "OrgConnectionType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionCreate.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionCreateAttributes.ts b/services/org_connections/src/v2/models/OrgConnectionCreateAttributes.ts new file mode 100644 index 000000000000..2e6de93cdff7 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionCreateAttributes.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionTypeEnum } from "./OrgConnectionTypeEnum"; + +/** + * Attributes for creating an org connection. + */ +export class OrgConnectionCreateAttributes { + /** + * List of connection types to establish. + */ + "connectionTypes": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + connectionTypes: { + baseName: "connection_types", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionCreateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionCreateRelationships.ts b/services/org_connections/src/v2/models/OrgConnectionCreateRelationships.ts new file mode 100644 index 000000000000..3944cf5c9bb1 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionCreateRelationships.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionOrgRelationship } from "./OrgConnectionOrgRelationship"; + +/** + * Relationships for org connection creation. + */ +export class OrgConnectionCreateRelationships { + /** + * Org relationship. + */ + "sinkOrg": OrgConnectionOrgRelationship; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + sinkOrg: { + baseName: "sink_org", + type: "OrgConnectionOrgRelationship", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionCreateRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionCreateRequest.ts b/services/org_connections/src/v2/models/OrgConnectionCreateRequest.ts new file mode 100644 index 000000000000..fd0e12b236b2 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionCreateRequest.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionCreate } from "./OrgConnectionCreate"; + +/** + * Request to create an org connection. + */ +export class OrgConnectionCreateRequest { + /** + * Org connection creation data. + */ + "data": OrgConnectionCreate; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "OrgConnectionCreate", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionListResponse.ts b/services/org_connections/src/v2/models/OrgConnectionListResponse.ts new file mode 100644 index 000000000000..2734f0c646d7 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionListResponse.ts @@ -0,0 +1,56 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnection } from "./OrgConnection"; +import { OrgConnectionListResponseMeta } from "./OrgConnectionListResponseMeta"; + +/** + * Response containing a list of org connections. + */ +export class OrgConnectionListResponse { + /** + * List of org connections. + */ + "data": Array; + /** + * Pagination metadata. + */ + "meta"?: OrgConnectionListResponseMeta; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + meta: { + baseName: "meta", + type: "OrgConnectionListResponseMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionListResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionListResponseMeta.ts b/services/org_connections/src/v2/models/OrgConnectionListResponseMeta.ts new file mode 100644 index 000000000000..029159c9641d --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionListResponseMeta.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionListResponseMetaPage } from "./OrgConnectionListResponseMetaPage"; + +/** + * Pagination metadata. + */ +export class OrgConnectionListResponseMeta { + /** + * Page information. + */ + "page"?: OrgConnectionListResponseMetaPage; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + page: { + baseName: "page", + type: "OrgConnectionListResponseMetaPage", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionListResponseMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionListResponseMetaPage.ts b/services/org_connections/src/v2/models/OrgConnectionListResponseMetaPage.ts new file mode 100644 index 000000000000..915dd3bfd516 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionListResponseMetaPage.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Page information. + */ +export class OrgConnectionListResponseMetaPage { + /** + * Total number of org connections. + */ + "totalCount"?: number; + /** + * Total number of org connections matching the filter. + */ + "totalFilteredCount"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + totalCount: { + baseName: "total_count", + type: "number", + format: "int64", + }, + totalFilteredCount: { + baseName: "total_filtered_count", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionListResponseMetaPage.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionOrgRelationship.ts b/services/org_connections/src/v2/models/OrgConnectionOrgRelationship.ts new file mode 100644 index 000000000000..8a47c9efde50 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionOrgRelationship.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionOrgRelationshipData } from "./OrgConnectionOrgRelationshipData"; + +/** + * Org relationship. + */ +export class OrgConnectionOrgRelationship { + /** + * The definition of `OrgConnectionOrgRelationshipData` object. + */ + "data"?: OrgConnectionOrgRelationshipData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "OrgConnectionOrgRelationshipData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionOrgRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionOrgRelationshipData.ts b/services/org_connections/src/v2/models/OrgConnectionOrgRelationshipData.ts new file mode 100644 index 000000000000..c698efb7d1c7 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionOrgRelationshipData.ts @@ -0,0 +1,62 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionOrgRelationshipDataType } from "./OrgConnectionOrgRelationshipDataType"; + +/** + * The definition of `OrgConnectionOrgRelationshipData` object. + */ +export class OrgConnectionOrgRelationshipData { + /** + * Org UUID. + */ + "id"?: string; + /** + * Org name. + */ + "name"?: string; + /** + * The type of the organization relationship. + */ + "type"?: OrgConnectionOrgRelationshipDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + type: { + baseName: "type", + type: "OrgConnectionOrgRelationshipDataType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionOrgRelationshipData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionOrgRelationshipDataType.ts b/services/org_connections/src/v2/models/OrgConnectionOrgRelationshipDataType.ts new file mode 100644 index 000000000000..358568b3b0b4 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionOrgRelationshipDataType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * The type of the organization relationship. + */ +export type OrgConnectionOrgRelationshipDataType = typeof ORGS | UnparsedObject; +export const ORGS = "orgs"; diff --git a/services/org_connections/src/v2/models/OrgConnectionRelationships.ts b/services/org_connections/src/v2/models/OrgConnectionRelationships.ts new file mode 100644 index 000000000000..c53ee12c4fec --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionRelationships.ts @@ -0,0 +1,63 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionOrgRelationship } from "./OrgConnectionOrgRelationship"; +import { OrgConnectionUserRelationship } from "./OrgConnectionUserRelationship"; + +/** + * Related organizations and user. + */ +export class OrgConnectionRelationships { + /** + * User relationship. + */ + "createdBy"?: OrgConnectionUserRelationship; + /** + * Org relationship. + */ + "sinkOrg"?: OrgConnectionOrgRelationship; + /** + * Org relationship. + */ + "sourceOrg"?: OrgConnectionOrgRelationship; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + createdBy: { + baseName: "created_by", + type: "OrgConnectionUserRelationship", + }, + sinkOrg: { + baseName: "sink_org", + type: "OrgConnectionOrgRelationship", + }, + sourceOrg: { + baseName: "source_org", + type: "OrgConnectionOrgRelationship", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionResponse.ts b/services/org_connections/src/v2/models/OrgConnectionResponse.ts new file mode 100644 index 000000000000..221d5484e1ba --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionResponse.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnection } from "./OrgConnection"; + +/** + * Response containing a single org connection. + */ +export class OrgConnectionResponse { + /** + * An org connection. + */ + "data": OrgConnection; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "OrgConnection", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionType.ts b/services/org_connections/src/v2/models/OrgConnectionType.ts new file mode 100644 index 000000000000..70c026e8f10b --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Org connection type. + */ +export type OrgConnectionType = typeof ORG_CONNECTION | UnparsedObject; +export const ORG_CONNECTION = "org_connection"; diff --git a/services/org_connections/src/v2/models/OrgConnectionTypeEnum.ts b/services/org_connections/src/v2/models/OrgConnectionTypeEnum.ts new file mode 100644 index 000000000000..a0af403d38b8 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionTypeEnum.ts @@ -0,0 +1,11 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Available connection types between organizations. + */ +export type OrgConnectionTypeEnum = + | typeof LOGS + | typeof METRICS + | UnparsedObject; +export const LOGS = "logs"; +export const METRICS = "metrics"; diff --git a/services/org_connections/src/v2/models/OrgConnectionUpdate.ts b/services/org_connections/src/v2/models/OrgConnectionUpdate.ts new file mode 100644 index 000000000000..be7a776f9a46 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionUpdate.ts @@ -0,0 +1,67 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionType } from "./OrgConnectionType"; +import { OrgConnectionUpdateAttributes } from "./OrgConnectionUpdateAttributes"; + +/** + * Org connection update data. + */ +export class OrgConnectionUpdate { + /** + * Attributes for updating an org connection. + */ + "attributes": OrgConnectionUpdateAttributes; + /** + * The unique identifier of the org connection. + */ + "id": string; + /** + * Org connection type. + */ + "type": OrgConnectionType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "OrgConnectionUpdateAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + format: "uuid", + }, + type: { + baseName: "type", + type: "OrgConnectionType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionUpdate.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionUpdateAttributes.ts b/services/org_connections/src/v2/models/OrgConnectionUpdateAttributes.ts new file mode 100644 index 000000000000..8b6fcad9534f --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionUpdateAttributes.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionTypeEnum } from "./OrgConnectionTypeEnum"; + +/** + * Attributes for updating an org connection. + */ +export class OrgConnectionUpdateAttributes { + /** + * Updated list of connection types. + */ + "connectionTypes": Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + connectionTypes: { + baseName: "connection_types", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionUpdateAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionUpdateRequest.ts b/services/org_connections/src/v2/models/OrgConnectionUpdateRequest.ts new file mode 100644 index 000000000000..9a13be134f69 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionUpdateRequest.ts @@ -0,0 +1,47 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionUpdate } from "./OrgConnectionUpdate"; + +/** + * Request to update an org connection. + */ +export class OrgConnectionUpdateRequest { + /** + * Org connection update data. + */ + "data": OrgConnectionUpdate; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "OrgConnectionUpdate", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionUpdateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionUserRelationship.ts b/services/org_connections/src/v2/models/OrgConnectionUserRelationship.ts new file mode 100644 index 000000000000..c2a35dc0ce06 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionUserRelationship.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionUserRelationshipData } from "./OrgConnectionUserRelationshipData"; + +/** + * User relationship. + */ +export class OrgConnectionUserRelationship { + /** + * The data for a user relationship. + */ + "data"?: OrgConnectionUserRelationshipData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "OrgConnectionUserRelationshipData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionUserRelationship.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionUserRelationshipData.ts b/services/org_connections/src/v2/models/OrgConnectionUserRelationshipData.ts new file mode 100644 index 000000000000..d03f1ea867f7 --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionUserRelationshipData.ts @@ -0,0 +1,62 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { OrgConnectionUserRelationshipDataType } from "./OrgConnectionUserRelationshipDataType"; + +/** + * The data for a user relationship. + */ +export class OrgConnectionUserRelationshipData { + /** + * User UUID. + */ + "id"?: string; + /** + * User name. + */ + "name"?: string; + /** + * The type of the user relationship. + */ + "type"?: OrgConnectionUserRelationshipDataType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + type: { + baseName: "type", + type: "OrgConnectionUserRelationshipDataType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return OrgConnectionUserRelationshipData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/org_connections/src/v2/models/OrgConnectionUserRelationshipDataType.ts b/services/org_connections/src/v2/models/OrgConnectionUserRelationshipDataType.ts new file mode 100644 index 000000000000..cf8722bbed7d --- /dev/null +++ b/services/org_connections/src/v2/models/OrgConnectionUserRelationshipDataType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * The type of the user relationship. + */ +export type OrgConnectionUserRelationshipDataType = + | typeof USERS + | UnparsedObject; +export const USERS = "users"; diff --git a/services/org_connections/src/v2/models/TypingInfo.ts b/services/org_connections/src/v2/models/TypingInfo.ts new file mode 100644 index 000000000000..a3dbddebe5fb --- /dev/null +++ b/services/org_connections/src/v2/models/TypingInfo.ts @@ -0,0 +1,52 @@ +import { ModelTypingInfo } from "@datadog/datadog-api-client"; + +import { APIErrorResponse } from "./APIErrorResponse"; +import { OrgConnection } from "./OrgConnection"; +import { OrgConnectionAttributes } from "./OrgConnectionAttributes"; +import { OrgConnectionCreate } from "./OrgConnectionCreate"; +import { OrgConnectionCreateAttributes } from "./OrgConnectionCreateAttributes"; +import { OrgConnectionCreateRelationships } from "./OrgConnectionCreateRelationships"; +import { OrgConnectionCreateRequest } from "./OrgConnectionCreateRequest"; +import { OrgConnectionListResponse } from "./OrgConnectionListResponse"; +import { OrgConnectionListResponseMeta } from "./OrgConnectionListResponseMeta"; +import { OrgConnectionListResponseMetaPage } from "./OrgConnectionListResponseMetaPage"; +import { OrgConnectionOrgRelationship } from "./OrgConnectionOrgRelationship"; +import { OrgConnectionOrgRelationshipData } from "./OrgConnectionOrgRelationshipData"; +import { OrgConnectionRelationships } from "./OrgConnectionRelationships"; +import { OrgConnectionResponse } from "./OrgConnectionResponse"; +import { OrgConnectionUpdate } from "./OrgConnectionUpdate"; +import { OrgConnectionUpdateAttributes } from "./OrgConnectionUpdateAttributes"; +import { OrgConnectionUpdateRequest } from "./OrgConnectionUpdateRequest"; +import { OrgConnectionUserRelationship } from "./OrgConnectionUserRelationship"; +import { OrgConnectionUserRelationshipData } from "./OrgConnectionUserRelationshipData"; + +export const TypingInfo: ModelTypingInfo = { + enumsMap: { + OrgConnectionOrgRelationshipDataType: ["orgs"], + OrgConnectionType: ["org_connection"], + OrgConnectionTypeEnum: ["logs", "metrics"], + OrgConnectionUserRelationshipDataType: ["users"], + }, + oneOfMap: {}, + typeMap: { + APIErrorResponse: APIErrorResponse, + OrgConnection: OrgConnection, + OrgConnectionAttributes: OrgConnectionAttributes, + OrgConnectionCreate: OrgConnectionCreate, + OrgConnectionCreateAttributes: OrgConnectionCreateAttributes, + OrgConnectionCreateRelationships: OrgConnectionCreateRelationships, + OrgConnectionCreateRequest: OrgConnectionCreateRequest, + OrgConnectionListResponse: OrgConnectionListResponse, + OrgConnectionListResponseMeta: OrgConnectionListResponseMeta, + OrgConnectionListResponseMetaPage: OrgConnectionListResponseMetaPage, + OrgConnectionOrgRelationship: OrgConnectionOrgRelationship, + OrgConnectionOrgRelationshipData: OrgConnectionOrgRelationshipData, + OrgConnectionRelationships: OrgConnectionRelationships, + OrgConnectionResponse: OrgConnectionResponse, + OrgConnectionUpdate: OrgConnectionUpdate, + OrgConnectionUpdateAttributes: OrgConnectionUpdateAttributes, + OrgConnectionUpdateRequest: OrgConnectionUpdateRequest, + OrgConnectionUserRelationship: OrgConnectionUserRelationship, + OrgConnectionUserRelationshipData: OrgConnectionUserRelationshipData, + }, +}; diff --git a/services/org_connections/tsconfig.json b/services/org_connections/tsconfig.json new file mode 100644 index 000000000000..d6c32bfb893c --- /dev/null +++ b/services/org_connections/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "strict": true, + /* Basic Options */ + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + + "esModuleInterop": true, + "resolveJsonModule": true, + + "noImplicitAny": true, + "noImplicitThis": true, + + /* Additional Checks */ + "noUnusedLocals": false /* Report errors on unused locals. */, // TODO: reenable (unused imports!) + "noUnusedParameters": false /* Report errors on unused parameters. */, // TODO: set to true again + "noImplicitReturns": true /* Report error when not all code paths in function return a value. */, + "noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */, + + "sourceMap": true, + "outDir": "./dist", + "lib": ["es6", "es7"] + }, + "exclude": ["dist", "node_modules", "tests"], + "include": ["src"] +} diff --git a/yarn.lock b/yarn.lock index f98caf115c50..fc15e08208da 100644 --- a/yarn.lock +++ b/yarn.lock @@ -766,6 +766,15 @@ __metadata: languageName: unknown linkType: soft +"@datadog/datadog-api-client-org-connections@workspace:services/org_connections": + version: 0.0.0-use.local + resolution: "@datadog/datadog-api-client-org-connections@workspace:services/org_connections" + dependencies: + "@datadog/datadog-api-client": "npm:^2.0.0-beta.0" + typescript: "npm:5.8.3" + languageName: unknown + linkType: soft + "@datadog/datadog-api-client-organizations@workspace:services/organizations": version: 0.0.0-use.local resolution: "@datadog/datadog-api-client-organizations@workspace:services/organizations"