From dfbb656dfd3307e411f201475ca31210a90bdfde Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 4 Sep 2025 18:45:05 +0000 Subject: [PATCH] Regenerate client from commit d603aca of spec repo --- .generator/schemas/v2/openapi.yaml | 407 ++++++++++++++++++ docs/datadog_api_client.v2.api.rst | 7 + docs/datadog_api_client.v2.model.rst | 154 +++++++ .../org-connections/CreateOrgConnections.py | 41 ++ .../org-connections/DeleteOrgConnections.py | 17 + .../v2/org-connections/ListOrgConnections.py | 13 + .../org-connections/UpdateOrgConnections.py | 35 ++ .../v2/api/org_connections_api.py | 178 ++++++++ src/datadog_api_client/v2/apis/__init__.py | 2 + .../v2/model/org_connection.py | 70 +++ .../v2/model/org_connection_attributes.py | 47 ++ .../v2/model/org_connection_create.py | 62 +++ .../model/org_connection_create_attributes.py | 46 ++ .../org_connection_create_relationships.py | 40 ++ .../v2/model/org_connection_create_request.py | 40 ++ .../v2/model/org_connection_list_response.py | 53 +++ .../org_connection_list_response_meta.py | 42 ++ .../org_connection_list_response_meta_page.py | 45 ++ .../model/org_connection_org_relationship.py | 42 ++ .../org_connection_org_relationship_data.py | 66 +++ ...g_connection_org_relationship_data_type.py | 35 ++ .../v2/model/org_connection_relationships.py | 64 +++ .../v2/model/org_connection_response.py | 40 ++ .../v2/model/org_connection_type.py | 35 ++ .../v2/model/org_connection_type_enum.py | 38 ++ .../v2/model/org_connection_update.py | 55 +++ .../model/org_connection_update_attributes.py | 46 ++ .../v2/model/org_connection_update_request.py | 40 ++ .../model/org_connection_user_relationship.py | 42 ++ .../org_connection_user_relationship_data.py | 66 +++ ..._connection_user_relationship_data_type.py | 35 ++ src/datadog_api_client/v2/models/__init__.py | 44 ++ ...ection_returns_bad_request_response.frozen | 1 + ...nnection_returns_bad_request_response.yaml | 21 + ...onnection_returns_conflict_response.frozen | 1 + ..._connection_returns_conflict_response.yaml | 62 +++ ...nnection_returns_not_found_response.frozen | 1 + ...connection_returns_not_found_response.yaml | 22 + ..._org_connection_returns_ok_response.frozen | 1 + ...te_org_connection_returns_ok_response.yaml | 43 ++ ...ection_returns_bad_request_response.frozen | 1 + ...nnection_returns_bad_request_response.yaml | 18 + ...nnection_returns_not_found_response.frozen | 1 + ...connection_returns_not_found_response.yaml | 19 + ..._org_connection_returns_ok_response.frozen | 1 + ...te_org_connection_returns_ok_response.yaml | 60 +++ ...org_connections_returns_ok_response.frozen | 1 + ...t_org_connections_returns_ok_response.yaml | 20 + ...ection_returns_bad_request_response.frozen | 1 + ...nnection_returns_bad_request_response.yaml | 61 +++ ...nnection_returns_not_found_response.frozen | 1 + ...connection_returns_not_found_response.yaml | 62 +++ ..._org_connection_returns_ok_response.frozen | 1 + ...te_org_connection_returns_ok_response.yaml | 63 +++ tests/v2/features/given.json | 13 + tests/v2/features/org_connections.feature | 95 ++++ tests/v2/features/undo.json | 31 ++ 57 files changed, 2548 insertions(+) create mode 100644 examples/v2/org-connections/CreateOrgConnections.py create mode 100644 examples/v2/org-connections/DeleteOrgConnections.py create mode 100644 examples/v2/org-connections/ListOrgConnections.py create mode 100644 examples/v2/org-connections/UpdateOrgConnections.py create mode 100644 src/datadog_api_client/v2/api/org_connections_api.py create mode 100644 src/datadog_api_client/v2/model/org_connection.py create mode 100644 src/datadog_api_client/v2/model/org_connection_attributes.py create mode 100644 src/datadog_api_client/v2/model/org_connection_create.py create mode 100644 src/datadog_api_client/v2/model/org_connection_create_attributes.py create mode 100644 src/datadog_api_client/v2/model/org_connection_create_relationships.py create mode 100644 src/datadog_api_client/v2/model/org_connection_create_request.py create mode 100644 src/datadog_api_client/v2/model/org_connection_list_response.py create mode 100644 src/datadog_api_client/v2/model/org_connection_list_response_meta.py create mode 100644 src/datadog_api_client/v2/model/org_connection_list_response_meta_page.py create mode 100644 src/datadog_api_client/v2/model/org_connection_org_relationship.py create mode 100644 src/datadog_api_client/v2/model/org_connection_org_relationship_data.py create mode 100644 src/datadog_api_client/v2/model/org_connection_org_relationship_data_type.py create mode 100644 src/datadog_api_client/v2/model/org_connection_relationships.py create mode 100644 src/datadog_api_client/v2/model/org_connection_response.py create mode 100644 src/datadog_api_client/v2/model/org_connection_type.py create mode 100644 src/datadog_api_client/v2/model/org_connection_type_enum.py create mode 100644 src/datadog_api_client/v2/model/org_connection_update.py create mode 100644 src/datadog_api_client/v2/model/org_connection_update_attributes.py create mode 100644 src/datadog_api_client/v2/model/org_connection_update_request.py create mode 100644 src/datadog_api_client/v2/model/org_connection_user_relationship.py create mode 100644 src/datadog_api_client/v2/model/org_connection_user_relationship_data.py create mode 100644 src/datadog_api_client/v2/model/org_connection_user_relationship_data_type.py create mode 100644 tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_conflict_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_conflict_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_list_org_connections_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_list_org_connections_returns_ok_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_bad_request_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_bad_request_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_not_found_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_not_found_response.yaml create mode 100644 tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_ok_response.frozen create mode 100644 tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_ok_response.yaml create mode 100644 tests/v2/features/org_connections.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b0d3125fb5..ce80244d23 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -707,6 +707,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 @@ -31762,6 +31771,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: @@ -46610,6 +46868,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 @@ -60010,6 +60270,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, @@ -70600,6 +71002,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/docs/datadog_api_client.v2.api.rst b/docs/datadog_api_client.v2.api.rst index 1bb57d8a4a..f03f141a8c 100644 --- a/docs/datadog_api_client.v2.api.rst +++ b/docs/datadog_api_client.v2.api.rst @@ -354,6 +354,13 @@ datadog\_api\_client.v2.api.opsgenie\_integration\_api module :members: :show-inheritance: +datadog\_api\_client.v2.api.org\_connections\_api module +-------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.api.org_connections_api + :members: + :show-inheritance: + datadog\_api\_client.v2.api.organizations\_api module ----------------------------------------------------- diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index 1830caf0f8..0bcab28b6d 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -14018,6 +14018,160 @@ datadog\_api\_client.v2.model.org\_config\_write\_request module :members: :show-inheritance: +datadog\_api\_client.v2.model.org\_connection module +---------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_attributes module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_create module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.org_connection_create + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_create\_attributes module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.org_connection_create_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_create\_relationships module +--------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_create_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_create\_request module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_create_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_list\_response module +-------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_list_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_list\_response\_meta module +-------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_list_response_meta + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_list\_response\_meta\_page module +-------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_list_response_meta_page + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_org\_relationship module +----------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_org_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_org\_relationship\_data module +----------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_org_relationship_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_org\_relationship\_data\_type module +----------------------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_org_relationship_data_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_relationships module +------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_relationships + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_response module +-------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_response + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_type module +---------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_type + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_type\_enum module +---------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_type_enum + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_update module +------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.org_connection_update + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_update\_attributes module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.org_connection_update_attributes + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_update\_request module +--------------------------------------------------------------------- + +.. automodule:: datadog_api_client.v2.model.org_connection_update_request + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_user\_relationship module +------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.org_connection_user_relationship + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_user\_relationship\_data module +------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.org_connection_user_relationship_data + :members: + :show-inheritance: + +datadog\_api\_client.v2.model.org\_connection\_user\_relationship\_data\_type module +------------------------------------------------------------------------------------ + +.. automodule:: datadog_api_client.v2.model.org_connection_user_relationship_data_type + :members: + :show-inheritance: + datadog\_api\_client.v2.model.organization module ------------------------------------------------- diff --git a/examples/v2/org-connections/CreateOrgConnections.py b/examples/v2/org-connections/CreateOrgConnections.py new file mode 100644 index 0000000000..818b88e6b8 --- /dev/null +++ b/examples/v2/org-connections/CreateOrgConnections.py @@ -0,0 +1,41 @@ +""" +Create Org Connection returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_connections_api import OrgConnectionsApi +from datadog_api_client.v2.model.org_connection_create import OrgConnectionCreate +from datadog_api_client.v2.model.org_connection_create_attributes import OrgConnectionCreateAttributes +from datadog_api_client.v2.model.org_connection_create_relationships import OrgConnectionCreateRelationships +from datadog_api_client.v2.model.org_connection_create_request import OrgConnectionCreateRequest +from datadog_api_client.v2.model.org_connection_org_relationship import OrgConnectionOrgRelationship +from datadog_api_client.v2.model.org_connection_org_relationship_data import OrgConnectionOrgRelationshipData +from datadog_api_client.v2.model.org_connection_org_relationship_data_type import OrgConnectionOrgRelationshipDataType +from datadog_api_client.v2.model.org_connection_type import OrgConnectionType +from datadog_api_client.v2.model.org_connection_type_enum import OrgConnectionTypeEnum + +body = OrgConnectionCreateRequest( + data=OrgConnectionCreate( + type=OrgConnectionType.ORG_CONNECTION, + relationships=OrgConnectionCreateRelationships( + sink_org=OrgConnectionOrgRelationship( + data=OrgConnectionOrgRelationshipData( + type=OrgConnectionOrgRelationshipDataType.ORGS, + id="83999dcd-7f97-11f0-8de1-1ecf66f1aa85", + ), + ), + ), + attributes=OrgConnectionCreateAttributes( + connection_types=[ + OrgConnectionTypeEnum.LOGS, + ], + ), + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgConnectionsApi(api_client) + response = api_instance.create_org_connections(body=body) + + print(response) diff --git a/examples/v2/org-connections/DeleteOrgConnections.py b/examples/v2/org-connections/DeleteOrgConnections.py new file mode 100644 index 0000000000..058038b6b3 --- /dev/null +++ b/examples/v2/org-connections/DeleteOrgConnections.py @@ -0,0 +1,17 @@ +""" +Delete Org Connection returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_connections_api import OrgConnectionsApi + +# there is a valid "org_connection" in the system +ORG_CONNECTION_DATA_ID = environ["ORG_CONNECTION_DATA_ID"] + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgConnectionsApi(api_client) + api_instance.delete_org_connections( + connection_id=ORG_CONNECTION_DATA_ID, + ) diff --git a/examples/v2/org-connections/ListOrgConnections.py b/examples/v2/org-connections/ListOrgConnections.py new file mode 100644 index 0000000000..f3a4b6adbb --- /dev/null +++ b/examples/v2/org-connections/ListOrgConnections.py @@ -0,0 +1,13 @@ +""" +List Org Connections returns "OK" response +""" + +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_connections_api import OrgConnectionsApi + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgConnectionsApi(api_client) + response = api_instance.list_org_connections() + + print(response) diff --git a/examples/v2/org-connections/UpdateOrgConnections.py b/examples/v2/org-connections/UpdateOrgConnections.py new file mode 100644 index 0000000000..b4f356d3ad --- /dev/null +++ b/examples/v2/org-connections/UpdateOrgConnections.py @@ -0,0 +1,35 @@ +""" +Update Org Connection returns "OK" response +""" + +from os import environ +from datadog_api_client import ApiClient, Configuration +from datadog_api_client.v2.api.org_connections_api import OrgConnectionsApi +from datadog_api_client.v2.model.org_connection_type import OrgConnectionType +from datadog_api_client.v2.model.org_connection_type_enum import OrgConnectionTypeEnum +from datadog_api_client.v2.model.org_connection_update import OrgConnectionUpdate +from datadog_api_client.v2.model.org_connection_update_attributes import OrgConnectionUpdateAttributes +from datadog_api_client.v2.model.org_connection_update_request import OrgConnectionUpdateRequest + +# there is a valid "org_connection" in the system +ORG_CONNECTION_DATA_ID = environ["ORG_CONNECTION_DATA_ID"] + +body = OrgConnectionUpdateRequest( + data=OrgConnectionUpdate( + type=OrgConnectionType.ORG_CONNECTION, + id=ORG_CONNECTION_DATA_ID, + attributes=OrgConnectionUpdateAttributes( + connection_types=[ + OrgConnectionTypeEnum.LOGS, + OrgConnectionTypeEnum.METRICS, + ], + ), + ), +) + +configuration = Configuration() +with ApiClient(configuration) as api_client: + api_instance = OrgConnectionsApi(api_client) + response = api_instance.update_org_connections(connection_id=ORG_CONNECTION_DATA_ID, body=body) + + print(response) diff --git a/src/datadog_api_client/v2/api/org_connections_api.py b/src/datadog_api_client/v2/api/org_connections_api.py new file mode 100644 index 0000000000..9f1a86c71e --- /dev/null +++ b/src/datadog_api_client/v2/api/org_connections_api.py @@ -0,0 +1,178 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Any, Dict + +from datadog_api_client.api_client import ApiClient, Endpoint as _Endpoint +from datadog_api_client.configuration import Configuration +from datadog_api_client.model_utils import ( + UUID, +) +from datadog_api_client.v2.model.org_connection_list_response import OrgConnectionListResponse +from datadog_api_client.v2.model.org_connection_response import OrgConnectionResponse +from datadog_api_client.v2.model.org_connection_create_request import OrgConnectionCreateRequest +from datadog_api_client.v2.model.org_connection_update_request import OrgConnectionUpdateRequest + + +class OrgConnectionsApi: + """ + Manage connections between organizations. Org connections allow for controlled sharing of data between different Datadog organizations. See the `Cross-Organization Visibiltiy `_ page for more information. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient(Configuration()) + self.api_client = api_client + + self._create_org_connections_endpoint = _Endpoint( + settings={ + "response_type": (OrgConnectionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/org_connections", + "operation_id": "create_org_connections", + "http_method": "POST", + "version": "v2", + }, + params_map={ + "body": { + "required": True, + "openapi_types": (OrgConnectionCreateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + self._delete_org_connections_endpoint = _Endpoint( + settings={ + "response_type": None, + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/org_connections/{connection_id}", + "operation_id": "delete_org_connections", + "http_method": "DELETE", + "version": "v2", + }, + params_map={ + "connection_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "connection_id", + "location": "path", + }, + }, + headers_map={ + "accept": ["*/*"], + }, + api_client=api_client, + ) + + self._list_org_connections_endpoint = _Endpoint( + settings={ + "response_type": (OrgConnectionListResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/org_connections", + "operation_id": "list_org_connections", + "http_method": "GET", + "version": "v2", + }, + params_map={}, + headers_map={ + "accept": ["application/json"], + }, + api_client=api_client, + ) + + self._update_org_connections_endpoint = _Endpoint( + settings={ + "response_type": (OrgConnectionResponse,), + "auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"], + "endpoint_path": "/api/v2/org_connections/{connection_id}", + "operation_id": "update_org_connections", + "http_method": "PATCH", + "version": "v2", + }, + params_map={ + "connection_id": { + "required": True, + "openapi_types": (UUID,), + "attribute": "connection_id", + "location": "path", + }, + "body": { + "required": True, + "openapi_types": (OrgConnectionUpdateRequest,), + "location": "body", + }, + }, + headers_map={"accept": ["application/json"], "content_type": ["application/json"]}, + api_client=api_client, + ) + + def create_org_connections( + self, + body: OrgConnectionCreateRequest, + ) -> OrgConnectionResponse: + """Create Org Connection. + + Create a new org connection between the current org and a target org. + + :type body: OrgConnectionCreateRequest + :rtype: OrgConnectionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["body"] = body + + return self._create_org_connections_endpoint.call_with_http_info(**kwargs) + + def delete_org_connections( + self, + connection_id: UUID, + ) -> None: + """Delete Org Connection. + + Delete an existing org connection. + + :param connection_id: The unique identifier of the org connection. + :type connection_id: UUID + :rtype: None + """ + kwargs: Dict[str, Any] = {} + kwargs["connection_id"] = connection_id + + return self._delete_org_connections_endpoint.call_with_http_info(**kwargs) + + def list_org_connections( + self, + ) -> OrgConnectionListResponse: + """List Org Connections. + + Returns a list of org connections. + + :rtype: OrgConnectionListResponse + """ + kwargs: Dict[str, Any] = {} + return self._list_org_connections_endpoint.call_with_http_info(**kwargs) + + def update_org_connections( + self, + connection_id: UUID, + body: OrgConnectionUpdateRequest, + ) -> OrgConnectionResponse: + """Update Org Connection. + + Update an existing org connection. + + :param connection_id: The unique identifier of the org connection. + :type connection_id: UUID + :type body: OrgConnectionUpdateRequest + :rtype: OrgConnectionResponse + """ + kwargs: Dict[str, Any] = {} + kwargs["connection_id"] = connection_id + + kwargs["body"] = body + + return self._update_org_connections_endpoint.call_with_http_info(**kwargs) diff --git a/src/datadog_api_client/v2/apis/__init__.py b/src/datadog_api_client/v2/apis/__init__.py index 6cbf0a8227..2840d35b2f 100644 --- a/src/datadog_api_client/v2/apis/__init__.py +++ b/src/datadog_api_client/v2/apis/__init__.py @@ -48,6 +48,7 @@ from datadog_api_client.v2.api.on_call_api import OnCallApi from datadog_api_client.v2.api.on_call_paging_api import OnCallPagingApi from datadog_api_client.v2.api.opsgenie_integration_api import OpsgenieIntegrationApi +from datadog_api_client.v2.api.org_connections_api import OrgConnectionsApi from datadog_api_client.v2.api.organizations_api import OrganizationsApi from datadog_api_client.v2.api.powerpack_api import PowerpackApi from datadog_api_client.v2.api.processes_api import ProcessesApi @@ -124,6 +125,7 @@ "OnCallApi", "OnCallPagingApi", "OpsgenieIntegrationApi", + "OrgConnectionsApi", "OrganizationsApi", "PowerpackApi", "ProcessesApi", diff --git a/src/datadog_api_client/v2/model/org_connection.py b/src/datadog_api_client/v2/model/org_connection.py new file mode 100644 index 0000000000..84bc0566e8 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection.py @@ -0,0 +1,70 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_attributes import OrgConnectionAttributes + from datadog_api_client.v2.model.org_connection_relationships import OrgConnectionRelationships + from datadog_api_client.v2.model.org_connection_type import OrgConnectionType + + +class OrgConnection(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_attributes import OrgConnectionAttributes + from datadog_api_client.v2.model.org_connection_relationships import OrgConnectionRelationships + from datadog_api_client.v2.model.org_connection_type import OrgConnectionType + + return { + "attributes": (OrgConnectionAttributes,), + "id": (UUID,), + "relationships": (OrgConnectionRelationships,), + "type": (OrgConnectionType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: OrgConnectionAttributes, + id: UUID, + relationships: OrgConnectionRelationships, + type: OrgConnectionType, + **kwargs, + ): + """ + An org connection. + + :param attributes: Org connection attributes. + :type attributes: OrgConnectionAttributes + + :param id: The unique identifier of the org connection. + :type id: UUID + + :param relationships: Related organizations and user. + :type relationships: OrgConnectionRelationships + + :param type: Org connection type. + :type type: OrgConnectionType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.relationships = relationships + self_.type = type diff --git a/src/datadog_api_client/v2/model/org_connection_attributes.py b/src/datadog_api_client/v2/model/org_connection_attributes.py new file mode 100644 index 0000000000..1db1c43b53 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_attributes.py @@ -0,0 +1,47 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + datetime, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_type_enum import OrgConnectionTypeEnum + + +class OrgConnectionAttributes(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_type_enum import OrgConnectionTypeEnum + + return { + "connection_types": ([OrgConnectionTypeEnum],), + "created_at": (datetime,), + } + + attribute_map = { + "connection_types": "connection_types", + "created_at": "created_at", + } + + def __init__(self_, connection_types: List[OrgConnectionTypeEnum], created_at: datetime, **kwargs): + """ + Org connection attributes. + + :param connection_types: List of connection types. + :type connection_types: [OrgConnectionTypeEnum] + + :param created_at: Timestamp when the connection was created. + :type created_at: datetime + """ + super().__init__(kwargs) + + self_.connection_types = connection_types + self_.created_at = created_at diff --git a/src/datadog_api_client/v2/model/org_connection_create.py b/src/datadog_api_client/v2/model/org_connection_create.py new file mode 100644 index 0000000000..6780145cb1 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_create.py @@ -0,0 +1,62 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_create_attributes import OrgConnectionCreateAttributes + from datadog_api_client.v2.model.org_connection_create_relationships import OrgConnectionCreateRelationships + from datadog_api_client.v2.model.org_connection_type import OrgConnectionType + + +class OrgConnectionCreate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_create_attributes import OrgConnectionCreateAttributes + from datadog_api_client.v2.model.org_connection_create_relationships import OrgConnectionCreateRelationships + from datadog_api_client.v2.model.org_connection_type import OrgConnectionType + + return { + "attributes": (OrgConnectionCreateAttributes,), + "relationships": (OrgConnectionCreateRelationships,), + "type": (OrgConnectionType,), + } + + attribute_map = { + "attributes": "attributes", + "relationships": "relationships", + "type": "type", + } + + def __init__( + self_, + attributes: OrgConnectionCreateAttributes, + relationships: OrgConnectionCreateRelationships, + type: OrgConnectionType, + **kwargs, + ): + """ + Org connection creation data. + + :param attributes: Attributes for creating an org connection. + :type attributes: OrgConnectionCreateAttributes + + :param relationships: Relationships for org connection creation. + :type relationships: OrgConnectionCreateRelationships + + :param type: Org connection type. + :type type: OrgConnectionType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.relationships = relationships + self_.type = type diff --git a/src/datadog_api_client/v2/model/org_connection_create_attributes.py b/src/datadog_api_client/v2/model/org_connection_create_attributes.py new file mode 100644 index 0000000000..d98d5bb626 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_create_attributes.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_type_enum import OrgConnectionTypeEnum + + +class OrgConnectionCreateAttributes(ModelNormal): + validations = { + "connection_types": { + "min_items": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_type_enum import OrgConnectionTypeEnum + + return { + "connection_types": ([OrgConnectionTypeEnum],), + } + + attribute_map = { + "connection_types": "connection_types", + } + + def __init__(self_, connection_types: List[OrgConnectionTypeEnum], **kwargs): + """ + Attributes for creating an org connection. + + :param connection_types: List of connection types to establish. + :type connection_types: [OrgConnectionTypeEnum] + """ + super().__init__(kwargs) + + self_.connection_types = connection_types diff --git a/src/datadog_api_client/v2/model/org_connection_create_relationships.py b/src/datadog_api_client/v2/model/org_connection_create_relationships.py new file mode 100644 index 0000000000..657d61fbb5 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_create_relationships.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_org_relationship import OrgConnectionOrgRelationship + + +class OrgConnectionCreateRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_org_relationship import OrgConnectionOrgRelationship + + return { + "sink_org": (OrgConnectionOrgRelationship,), + } + + attribute_map = { + "sink_org": "sink_org", + } + + def __init__(self_, sink_org: OrgConnectionOrgRelationship, **kwargs): + """ + Relationships for org connection creation. + + :param sink_org: Org relationship. + :type sink_org: OrgConnectionOrgRelationship + """ + super().__init__(kwargs) + + self_.sink_org = sink_org diff --git a/src/datadog_api_client/v2/model/org_connection_create_request.py b/src/datadog_api_client/v2/model/org_connection_create_request.py new file mode 100644 index 0000000000..9b929329d3 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_create_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_create import OrgConnectionCreate + + +class OrgConnectionCreateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_create import OrgConnectionCreate + + return { + "data": (OrgConnectionCreate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: OrgConnectionCreate, **kwargs): + """ + Request to create an org connection. + + :param data: Org connection creation data. + :type data: OrgConnectionCreate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/org_connection_list_response.py b/src/datadog_api_client/v2/model/org_connection_list_response.py new file mode 100644 index 0000000000..e777963edb --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_list_response.py @@ -0,0 +1,53 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection import OrgConnection + from datadog_api_client.v2.model.org_connection_list_response_meta import OrgConnectionListResponseMeta + + +class OrgConnectionListResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection import OrgConnection + from datadog_api_client.v2.model.org_connection_list_response_meta import OrgConnectionListResponseMeta + + return { + "data": ([OrgConnection],), + "meta": (OrgConnectionListResponseMeta,), + } + + attribute_map = { + "data": "data", + "meta": "meta", + } + + def __init__( + self_, data: List[OrgConnection], meta: Union[OrgConnectionListResponseMeta, UnsetType] = unset, **kwargs + ): + """ + Response containing a list of org connections. + + :param data: List of org connections. + :type data: [OrgConnection] + + :param meta: Pagination metadata. + :type meta: OrgConnectionListResponseMeta, optional + """ + if meta is not unset: + kwargs["meta"] = meta + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/org_connection_list_response_meta.py b/src/datadog_api_client/v2/model/org_connection_list_response_meta.py new file mode 100644 index 0000000000..2a7c7e5f50 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_list_response_meta.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_list_response_meta_page import OrgConnectionListResponseMetaPage + + +class OrgConnectionListResponseMeta(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_list_response_meta_page import OrgConnectionListResponseMetaPage + + return { + "page": (OrgConnectionListResponseMetaPage,), + } + + attribute_map = { + "page": "page", + } + + def __init__(self_, page: Union[OrgConnectionListResponseMetaPage, UnsetType] = unset, **kwargs): + """ + Pagination metadata. + + :param page: Page information. + :type page: OrgConnectionListResponseMetaPage, optional + """ + if page is not unset: + kwargs["page"] = page + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_connection_list_response_meta_page.py b/src/datadog_api_client/v2/model/org_connection_list_response_meta_page.py new file mode 100644 index 0000000000..00bc849641 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_list_response_meta_page.py @@ -0,0 +1,45 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +class OrgConnectionListResponseMetaPage(ModelNormal): + @cached_property + def openapi_types(_): + return { + "total_count": (int,), + "total_filtered_count": (int,), + } + + attribute_map = { + "total_count": "total_count", + "total_filtered_count": "total_filtered_count", + } + + def __init__( + self_, total_count: Union[int, UnsetType] = unset, total_filtered_count: Union[int, UnsetType] = unset, **kwargs + ): + """ + Page information. + + :param total_count: Total number of org connections. + :type total_count: int, optional + + :param total_filtered_count: Total number of org connections matching the filter. + :type total_filtered_count: int, optional + """ + if total_count is not unset: + kwargs["total_count"] = total_count + if total_filtered_count is not unset: + kwargs["total_filtered_count"] = total_filtered_count + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_connection_org_relationship.py b/src/datadog_api_client/v2/model/org_connection_org_relationship.py new file mode 100644 index 0000000000..2d9e89331e --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_org_relationship.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_org_relationship_data import OrgConnectionOrgRelationshipData + + +class OrgConnectionOrgRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_org_relationship_data import OrgConnectionOrgRelationshipData + + return { + "data": (OrgConnectionOrgRelationshipData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[OrgConnectionOrgRelationshipData, UnsetType] = unset, **kwargs): + """ + Org relationship. + + :param data: The definition of ``OrgConnectionOrgRelationshipData`` object. + :type data: OrgConnectionOrgRelationshipData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_connection_org_relationship_data.py b/src/datadog_api_client/v2/model/org_connection_org_relationship_data.py new file mode 100644 index 0000000000..04ae96f422 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_org_relationship_data.py @@ -0,0 +1,66 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_org_relationship_data_type import ( + OrgConnectionOrgRelationshipDataType, + ) + + +class OrgConnectionOrgRelationshipData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_org_relationship_data_type import ( + OrgConnectionOrgRelationshipDataType, + ) + + return { + "id": (str,), + "name": (str,), + "type": (OrgConnectionOrgRelationshipDataType,), + } + + attribute_map = { + "id": "id", + "name": "name", + "type": "type", + } + + def __init__( + self_, + id: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + type: Union[OrgConnectionOrgRelationshipDataType, UnsetType] = unset, + **kwargs, + ): + """ + The definition of ``OrgConnectionOrgRelationshipData`` object. + + :param id: Org UUID. + :type id: str, optional + + :param name: Org name. + :type name: str, optional + + :param type: The type of the organization relationship. + :type type: OrgConnectionOrgRelationshipDataType, optional + """ + if id is not unset: + kwargs["id"] = id + if name is not unset: + kwargs["name"] = name + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_connection_org_relationship_data_type.py b/src/datadog_api_client/v2/model/org_connection_org_relationship_data_type.py new file mode 100644 index 0000000000..aab3921017 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_org_relationship_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OrgConnectionOrgRelationshipDataType(ModelSimple): + """ + The type of the organization relationship. + + :param value: If omitted defaults to "orgs". Must be one of ["orgs"]. + :type value: str + """ + + allowed_values = { + "orgs", + } + ORGS: ClassVar["OrgConnectionOrgRelationshipDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OrgConnectionOrgRelationshipDataType.ORGS = OrgConnectionOrgRelationshipDataType("orgs") diff --git a/src/datadog_api_client/v2/model/org_connection_relationships.py b/src/datadog_api_client/v2/model/org_connection_relationships.py new file mode 100644 index 0000000000..5f4803dcac --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_relationships.py @@ -0,0 +1,64 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_user_relationship import OrgConnectionUserRelationship + from datadog_api_client.v2.model.org_connection_org_relationship import OrgConnectionOrgRelationship + + +class OrgConnectionRelationships(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_user_relationship import OrgConnectionUserRelationship + from datadog_api_client.v2.model.org_connection_org_relationship import OrgConnectionOrgRelationship + + return { + "created_by": (OrgConnectionUserRelationship,), + "sink_org": (OrgConnectionOrgRelationship,), + "source_org": (OrgConnectionOrgRelationship,), + } + + attribute_map = { + "created_by": "created_by", + "sink_org": "sink_org", + "source_org": "source_org", + } + + def __init__( + self_, + created_by: Union[OrgConnectionUserRelationship, UnsetType] = unset, + sink_org: Union[OrgConnectionOrgRelationship, UnsetType] = unset, + source_org: Union[OrgConnectionOrgRelationship, UnsetType] = unset, + **kwargs, + ): + """ + Related organizations and user. + + :param created_by: User relationship. + :type created_by: OrgConnectionUserRelationship, optional + + :param sink_org: Org relationship. + :type sink_org: OrgConnectionOrgRelationship, optional + + :param source_org: Org relationship. + :type source_org: OrgConnectionOrgRelationship, optional + """ + if created_by is not unset: + kwargs["created_by"] = created_by + if sink_org is not unset: + kwargs["sink_org"] = sink_org + if source_org is not unset: + kwargs["source_org"] = source_org + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_connection_response.py b/src/datadog_api_client/v2/model/org_connection_response.py new file mode 100644 index 0000000000..c70f4c4654 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_response.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection import OrgConnection + + +class OrgConnectionResponse(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection import OrgConnection + + return { + "data": (OrgConnection,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: OrgConnection, **kwargs): + """ + Response containing a single org connection. + + :param data: An org connection. + :type data: OrgConnection + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/org_connection_type.py b/src/datadog_api_client/v2/model/org_connection_type.py new file mode 100644 index 0000000000..cef66f0011 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OrgConnectionType(ModelSimple): + """ + Org connection type. + + :param value: If omitted defaults to "org_connection". Must be one of ["org_connection"]. + :type value: str + """ + + allowed_values = { + "org_connection", + } + ORG_CONNECTION: ClassVar["OrgConnectionType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OrgConnectionType.ORG_CONNECTION = OrgConnectionType("org_connection") diff --git a/src/datadog_api_client/v2/model/org_connection_type_enum.py b/src/datadog_api_client/v2/model/org_connection_type_enum.py new file mode 100644 index 0000000000..4715b7fa2c --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_type_enum.py @@ -0,0 +1,38 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OrgConnectionTypeEnum(ModelSimple): + """ + Available connection types between organizations. + + :param value: Must be one of ["logs", "metrics"]. + :type value: str + """ + + allowed_values = { + "logs", + "metrics", + } + LOGS: ClassVar["OrgConnectionTypeEnum"] + METRICS: ClassVar["OrgConnectionTypeEnum"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OrgConnectionTypeEnum.LOGS = OrgConnectionTypeEnum("logs") +OrgConnectionTypeEnum.METRICS = OrgConnectionTypeEnum("metrics") diff --git a/src/datadog_api_client/v2/model/org_connection_update.py b/src/datadog_api_client/v2/model/org_connection_update.py new file mode 100644 index 0000000000..e0349af779 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_update.py @@ -0,0 +1,55 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + UUID, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_update_attributes import OrgConnectionUpdateAttributes + from datadog_api_client.v2.model.org_connection_type import OrgConnectionType + + +class OrgConnectionUpdate(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_update_attributes import OrgConnectionUpdateAttributes + from datadog_api_client.v2.model.org_connection_type import OrgConnectionType + + return { + "attributes": (OrgConnectionUpdateAttributes,), + "id": (UUID,), + "type": (OrgConnectionType,), + } + + attribute_map = { + "attributes": "attributes", + "id": "id", + "type": "type", + } + + def __init__(self_, attributes: OrgConnectionUpdateAttributes, id: UUID, type: OrgConnectionType, **kwargs): + """ + Org connection update data. + + :param attributes: Attributes for updating an org connection. + :type attributes: OrgConnectionUpdateAttributes + + :param id: The unique identifier of the org connection. + :type id: UUID + + :param type: Org connection type. + :type type: OrgConnectionType + """ + super().__init__(kwargs) + + self_.attributes = attributes + self_.id = id + self_.type = type diff --git a/src/datadog_api_client/v2/model/org_connection_update_attributes.py b/src/datadog_api_client/v2/model/org_connection_update_attributes.py new file mode 100644 index 0000000000..42a8726fff --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_update_attributes.py @@ -0,0 +1,46 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_type_enum import OrgConnectionTypeEnum + + +class OrgConnectionUpdateAttributes(ModelNormal): + validations = { + "connection_types": { + "min_items": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_type_enum import OrgConnectionTypeEnum + + return { + "connection_types": ([OrgConnectionTypeEnum],), + } + + attribute_map = { + "connection_types": "connection_types", + } + + def __init__(self_, connection_types: List[OrgConnectionTypeEnum], **kwargs): + """ + Attributes for updating an org connection. + + :param connection_types: Updated list of connection types. + :type connection_types: [OrgConnectionTypeEnum] + """ + super().__init__(kwargs) + + self_.connection_types = connection_types diff --git a/src/datadog_api_client/v2/model/org_connection_update_request.py b/src/datadog_api_client/v2/model/org_connection_update_request.py new file mode 100644 index 0000000000..bf117eb6a5 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_update_request.py @@ -0,0 +1,40 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_update import OrgConnectionUpdate + + +class OrgConnectionUpdateRequest(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_update import OrgConnectionUpdate + + return { + "data": (OrgConnectionUpdate,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: OrgConnectionUpdate, **kwargs): + """ + Request to update an org connection. + + :param data: Org connection update data. + :type data: OrgConnectionUpdate + """ + super().__init__(kwargs) + + self_.data = data diff --git a/src/datadog_api_client/v2/model/org_connection_user_relationship.py b/src/datadog_api_client/v2/model/org_connection_user_relationship.py new file mode 100644 index 0000000000..a67c982275 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_user_relationship.py @@ -0,0 +1,42 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_user_relationship_data import OrgConnectionUserRelationshipData + + +class OrgConnectionUserRelationship(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_user_relationship_data import OrgConnectionUserRelationshipData + + return { + "data": (OrgConnectionUserRelationshipData,), + } + + attribute_map = { + "data": "data", + } + + def __init__(self_, data: Union[OrgConnectionUserRelationshipData, UnsetType] = unset, **kwargs): + """ + User relationship. + + :param data: The data for a user relationship. + :type data: OrgConnectionUserRelationshipData, optional + """ + if data is not unset: + kwargs["data"] = data + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_connection_user_relationship_data.py b/src/datadog_api_client/v2/model/org_connection_user_relationship_data.py new file mode 100644 index 0000000000..c74c1a84a0 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_user_relationship_data.py @@ -0,0 +1,66 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.org_connection_user_relationship_data_type import ( + OrgConnectionUserRelationshipDataType, + ) + + +class OrgConnectionUserRelationshipData(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.org_connection_user_relationship_data_type import ( + OrgConnectionUserRelationshipDataType, + ) + + return { + "id": (str,), + "name": (str,), + "type": (OrgConnectionUserRelationshipDataType,), + } + + attribute_map = { + "id": "id", + "name": "name", + "type": "type", + } + + def __init__( + self_, + id: Union[str, UnsetType] = unset, + name: Union[str, UnsetType] = unset, + type: Union[OrgConnectionUserRelationshipDataType, UnsetType] = unset, + **kwargs, + ): + """ + The data for a user relationship. + + :param id: User UUID. + :type id: str, optional + + :param name: User name. + :type name: str, optional + + :param type: The type of the user relationship. + :type type: OrgConnectionUserRelationshipDataType, optional + """ + if id is not unset: + kwargs["id"] = id + if name is not unset: + kwargs["name"] = name + if type is not unset: + kwargs["type"] = type + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/org_connection_user_relationship_data_type.py b/src/datadog_api_client/v2/model/org_connection_user_relationship_data_type.py new file mode 100644 index 0000000000..0e421797b9 --- /dev/null +++ b/src/datadog_api_client/v2/model/org_connection_user_relationship_data_type.py @@ -0,0 +1,35 @@ +# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +# This product includes software developed at Datadog (https://www.datadoghq.com/). +# Copyright 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelSimple, + cached_property, +) + +from typing import ClassVar + + +class OrgConnectionUserRelationshipDataType(ModelSimple): + """ + The type of the user relationship. + + :param value: If omitted defaults to "users". Must be one of ["users"]. + :type value: str + """ + + allowed_values = { + "users", + } + USERS: ClassVar["OrgConnectionUserRelationshipDataType"] + + @cached_property + def openapi_types(_): + return { + "value": (str,), + } + + +OrgConnectionUserRelationshipDataType.USERS = OrgConnectionUserRelationshipDataType("users") diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 7c9c882306..d427b80bf3 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -2814,6 +2814,28 @@ from datadog_api_client.v2.model.org_config_write import OrgConfigWrite from datadog_api_client.v2.model.org_config_write_attributes import OrgConfigWriteAttributes from datadog_api_client.v2.model.org_config_write_request import OrgConfigWriteRequest +from datadog_api_client.v2.model.org_connection import OrgConnection +from datadog_api_client.v2.model.org_connection_attributes import OrgConnectionAttributes +from datadog_api_client.v2.model.org_connection_create import OrgConnectionCreate +from datadog_api_client.v2.model.org_connection_create_attributes import OrgConnectionCreateAttributes +from datadog_api_client.v2.model.org_connection_create_relationships import OrgConnectionCreateRelationships +from datadog_api_client.v2.model.org_connection_create_request import OrgConnectionCreateRequest +from datadog_api_client.v2.model.org_connection_list_response import OrgConnectionListResponse +from datadog_api_client.v2.model.org_connection_list_response_meta import OrgConnectionListResponseMeta +from datadog_api_client.v2.model.org_connection_list_response_meta_page import OrgConnectionListResponseMetaPage +from datadog_api_client.v2.model.org_connection_org_relationship import OrgConnectionOrgRelationship +from datadog_api_client.v2.model.org_connection_org_relationship_data import OrgConnectionOrgRelationshipData +from datadog_api_client.v2.model.org_connection_org_relationship_data_type import OrgConnectionOrgRelationshipDataType +from datadog_api_client.v2.model.org_connection_relationships import OrgConnectionRelationships +from datadog_api_client.v2.model.org_connection_response import OrgConnectionResponse +from datadog_api_client.v2.model.org_connection_type import OrgConnectionType +from datadog_api_client.v2.model.org_connection_type_enum import OrgConnectionTypeEnum +from datadog_api_client.v2.model.org_connection_update import OrgConnectionUpdate +from datadog_api_client.v2.model.org_connection_update_attributes import OrgConnectionUpdateAttributes +from datadog_api_client.v2.model.org_connection_update_request import OrgConnectionUpdateRequest +from datadog_api_client.v2.model.org_connection_user_relationship import OrgConnectionUserRelationship +from datadog_api_client.v2.model.org_connection_user_relationship_data import OrgConnectionUserRelationshipData +from datadog_api_client.v2.model.org_connection_user_relationship_data_type import OrgConnectionUserRelationshipDataType from datadog_api_client.v2.model.organization import Organization from datadog_api_client.v2.model.organization_attributes import OrganizationAttributes from datadog_api_client.v2.model.organizations_type import OrganizationsType @@ -6014,6 +6036,28 @@ "OrgConfigWrite", "OrgConfigWriteAttributes", "OrgConfigWriteRequest", + "OrgConnection", + "OrgConnectionAttributes", + "OrgConnectionCreate", + "OrgConnectionCreateAttributes", + "OrgConnectionCreateRelationships", + "OrgConnectionCreateRequest", + "OrgConnectionListResponse", + "OrgConnectionListResponseMeta", + "OrgConnectionListResponseMetaPage", + "OrgConnectionOrgRelationship", + "OrgConnectionOrgRelationshipData", + "OrgConnectionOrgRelationshipDataType", + "OrgConnectionRelationships", + "OrgConnectionResponse", + "OrgConnectionType", + "OrgConnectionTypeEnum", + "OrgConnectionUpdate", + "OrgConnectionUpdateAttributes", + "OrgConnectionUpdateRequest", + "OrgConnectionUserRelationship", + "OrgConnectionUserRelationshipData", + "OrgConnectionUserRelationshipDataType", "Organization", "OrganizationAttributes", "OrganizationsType", diff --git a/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_bad_request_response.frozen new file mode 100644 index 0000000000..bdb5f4a2d2 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-26T20:19:35.269Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_bad_request_response.yaml new file mode 100644 index 0000000000..f15590e7bf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_bad_request_response.yaml @@ -0,0 +1,21 @@ +interactions: +- request: + body: '{"data":{"attributes":{"connection_types":["logs","logs"]},"relationships":{"sink_org":{"data":{"id":"83999dcd-7f97-11f0-8de1-1ecf66f1aa85","type":"orgs"}}},"type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/org_connections + response: + body: + string: '{"errors":["connection between orgs 4dee724d-00cc-11ea-a77b-570c9d03c6c5 + and 83999dcd-7f97-11f0-8de1-1ecf66f1aa85 is not allowed"]}' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_conflict_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_conflict_response.frozen new file mode 100644 index 0000000000..6f07529abc --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_conflict_response.frozen @@ -0,0 +1 @@ +2025-08-26T20:19:35.429Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_conflict_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_conflict_response.yaml new file mode 100644 index 0000000000..d928e2581f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_conflict_response.yaml @@ -0,0 +1,62 @@ +interactions: +- request: + body: '{"data":{"attributes":{"connection_types":["logs"]},"relationships":{"sink_org":{"data":{"id":"83999dcd-7f97-11f0-8de1-1ecf66f1aa85","type":"orgs"}}},"type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/org_connections + response: + body: + string: '{"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"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"connection_types":["logs"]},"relationships":{"sink_org":{"data":{"id":"83999dcd-7f97-11f0-8de1-1ecf66f1aa85","type":"orgs"}}},"type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/org_connections + response: + body: + string: '{"errors":["connection between orgs 4dee724d-00cc-11ea-a77b-570c9d03c6c5 + and 83999dcd-7f97-11f0-8de1-1ecf66f1aa85 already exists"]}' + headers: + content-type: + - application/json + status: + code: 409 + message: Conflict +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/b5d3a360-d6e2-4af7-8da2-b2ff41b9f5e0 + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_not_found_response.frozen new file mode 100644 index 0000000000..bdeeb5688d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-26T20:19:35.916Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_not_found_response.yaml new file mode 100644 index 0000000000..cb6d44a724 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_not_found_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: '{"data":{"attributes":{"connection_types":["logs"]},"relationships":{"sink_org":{"data":{"id":"nonexistent-org-id","type":"orgs"}}},"type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/org_connections + response: + body: + string: '{"errors":["Not found"]} + + ' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_ok_response.frozen new file mode 100644 index 0000000000..878b43f439 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-26T20:19:36.045Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_ok_response.yaml new file mode 100644 index 0000000000..b4e019a687 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_create_org_connection_returns_ok_response.yaml @@ -0,0 +1,43 @@ +interactions: +- request: + body: '{"data":{"attributes":{"connection_types":["logs"]},"relationships":{"sink_org":{"data":{"id":"83999dcd-7f97-11f0-8de1-1ecf66f1aa85","type":"orgs"}}},"type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/org_connections + response: + body: + string: '{"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"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/40bbb1c2-32b2-4aa3-8a1a-5d93b5382e3d + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_bad_request_response.frozen new file mode 100644 index 0000000000..563493e1bf --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-26T20:19:36.363Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_bad_request_response.yaml new file mode 100644 index 0000000000..37d4704fd7 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_bad_request_response.yaml @@ -0,0 +1,18 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/malformed_id + response: + body: + string: '{"errors":["connection id must be a valid uuid"]}' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_not_found_response.frozen new file mode 100644 index 0000000000..908df97ed0 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-26T20:19:36.481Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_not_found_response.yaml new file mode 100644 index 0000000000..cf7a90fa68 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_not_found_response.yaml @@ -0,0 +1,19 @@ +interactions: +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":["org connection with id:00000000-0000-0000-0000-000000000000 + not found not found"]}' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_ok_response.frozen new file mode 100644 index 0000000000..a6ac9aae21 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-26T20:19:36.615Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_ok_response.yaml new file mode 100644 index 0000000000..29f6ff0ea4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_delete_org_connection_returns_ok_response.yaml @@ -0,0 +1,60 @@ +interactions: +- request: + body: '{"data":{"attributes":{"connection_types":["logs"]},"relationships":{"sink_org":{"data":{"id":"83999dcd-7f97-11f0-8de1-1ecf66f1aa85","type":"orgs"}}},"type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/org_connections + response: + body: + string: '{"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"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/7b01f30c-6100-4cbf-b583-a5e353d7edb7 + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/7b01f30c-6100-4cbf-b583-a5e353d7edb7 + response: + body: + string: '{"errors":["org connection with id:7b01f30c-6100-4cbf-b583-a5e353d7edb7 + not found not found"]}' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_list_org_connections_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_list_org_connections_returns_ok_response.frozen new file mode 100644 index 0000000000..feb7d7484c --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_org_connections_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-26T20:19:37.084Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_list_org_connections_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_list_org_connections_returns_ok_response.yaml new file mode 100644 index 0000000000..68feae6a5f --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_list_org_connections_returns_ok_response.yaml @@ -0,0 +1,20 @@ +interactions: +- request: + body: null + headers: + accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/org_connections + response: + body: + string: '{"data":[],"meta":{"page":{"total_count":0,"total_filtered_count":0}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_bad_request_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_bad_request_response.frozen new file mode 100644 index 0000000000..c28d682e61 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_bad_request_response.frozen @@ -0,0 +1 @@ +2025-08-26T20:19:37.212Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_bad_request_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_bad_request_response.yaml new file mode 100644 index 0000000000..6469d02141 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_bad_request_response.yaml @@ -0,0 +1,61 @@ +interactions: +- request: + body: '{"data":{"attributes":{"connection_types":["logs"]},"relationships":{"sink_org":{"data":{"id":"83999dcd-7f97-11f0-8de1-1ecf66f1aa85","type":"orgs"}}},"type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/org_connections + response: + body: + string: '{"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"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"connection_types":["logs","logs"]},"id":"76e1a71f-81e5-40c8-b8e0-1b98265d26fe","type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/org_connections/76e1a71f-81e5-40c8-b8e0-1b98265d26fe + response: + body: + string: '{"errors":["Validation failed for input."]}' + headers: + content-type: + - application/json + status: + code: 400 + message: Bad Request +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/76e1a71f-81e5-40c8-b8e0-1b98265d26fe + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_not_found_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_not_found_response.frozen new file mode 100644 index 0000000000..742e61df8a --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_not_found_response.frozen @@ -0,0 +1 @@ +2025-08-26T20:19:37.609Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_not_found_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_not_found_response.yaml new file mode 100644 index 0000000000..2094d999f4 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_not_found_response.yaml @@ -0,0 +1,62 @@ +interactions: +- request: + body: '{"data":{"attributes":{"connection_types":["logs"]},"relationships":{"sink_org":{"data":{"id":"83999dcd-7f97-11f0-8de1-1ecf66f1aa85","type":"orgs"}}},"type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/org_connections + response: + body: + string: '{"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"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"connection_types":["logs","metrics"]},"id":"00000000-0000-0000-0000-000000000000","type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/org_connections/00000000-0000-0000-0000-000000000000 + response: + body: + string: '{"errors":["Org connection with id:00000000-0000-0000-0000-000000000000 + not found not found"]}' + headers: + content-type: + - application/json + status: + code: 404 + message: Not Found +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/d348b9ab-c7cf-4298-83a6-b4762fafff5e + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_ok_response.frozen b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_ok_response.frozen new file mode 100644 index 0000000000..291e5d534d --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_ok_response.frozen @@ -0,0 +1 @@ +2025-08-26T20:19:38.089Z \ No newline at end of file diff --git a/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_ok_response.yaml b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_ok_response.yaml new file mode 100644 index 0000000000..511b31f299 --- /dev/null +++ b/tests/v2/cassettes/test_scenarios/test_update_org_connection_returns_ok_response.yaml @@ -0,0 +1,63 @@ +interactions: +- request: + body: '{"data":{"attributes":{"connection_types":["logs"]},"relationships":{"sink_org":{"data":{"id":"83999dcd-7f97-11f0-8de1-1ecf66f1aa85","type":"orgs"}}},"type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/org_connections + response: + body: + string: '{"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"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: '{"data":{"attributes":{"connection_types":["logs","metrics"]},"id":"0105233a-4d7b-4c52-b364-cc968d003de0","type":"org_connection"}}' + headers: + accept: + - application/json + content-type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/org_connections/0105233a-4d7b-4c52-b364-cc968d003de0 + response: + body: + string: '{"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"}}}}} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +- request: + body: null + headers: + accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/0105233a-4d7b-4c52-b364-cc968d003de0 + response: + body: + string: '{} + + ' + headers: + content-type: + - application/json + status: + code: 200 + message: OK +version: 1 diff --git a/tests/v2/features/given.json b/tests/v2/features/given.json index 79e6d4c45d..ef93bc042e 100644 --- a/tests/v2/features/given.json +++ b/tests/v2/features/given.json @@ -569,6 +569,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/tests/v2/features/org_connections.feature b/tests/v2/features/org_connections.feature new file mode 100644 index 0000000000..321e7c77f2 --- /dev/null +++ b/tests/v2/features/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/tests/v2/features/undo.json b/tests/v2/features/undo.json index b3731714ef..1ade02a737 100644 --- a/tests/v2/features/undo.json +++ b/tests/v2/features/undo.json @@ -2252,6 +2252,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": {