From 85cf2c2cf5356817818c81d11f429404815f6be8 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 28 Aug 2025 14:38:35 +0000 Subject: [PATCH] Regenerate client from commit 969fb7c of spec repo --- .generator/schemas/v2/openapi.yaml | 407 ++++++++++++++++++ ...ection-returns-Bad-Request-response.frozen | 1 + ...onnection-returns-Bad-Request-response.yml | 25 ++ ...onnection-returns-Conflict-response.frozen | 1 + ...g-Connection-returns-Conflict-response.yml | 72 ++++ ...nnection-returns-Not-Found-response.frozen | 1 + ...-Connection-returns-Not-Found-response.yml | 26 ++ ...-Org-Connection-returns-OK-response.frozen | 1 + ...ate-Org-Connection-returns-OK-response.yml | 49 +++ ...ection-returns-Bad-Request-response.frozen | 1 + ...onnection-returns-Bad-Request-response.yml | 20 + ...nnection-returns-Not-Found-response.frozen | 1 + ...-Connection-returns-Not-Found-response.yml | 21 + ...-Org-Connection-returns-OK-response.frozen | 1 + ...ete-Org-Connection-returns-OK-response.yml | 68 +++ ...Org-Connections-returns-OK-response.frozen | 1 + ...st-Org-Connections-returns-OK-response.yml | 22 + ...ection-returns-Bad-Request-response.frozen | 1 + ...onnection-returns-Bad-Request-response.yml | 71 +++ ...nnection-returns-Not-Found-response.frozen | 1 + ...-Connection-returns-Not-Found-response.yml | 72 ++++ ...-Org-Connection-returns-OK-response.frozen | 1 + ...ate-Org-Connection-returns-OK-response.yml | 73 ++++ .../org-connections/CreateOrgConnections.rb | 24 ++ .../org-connections/DeleteOrgConnections.rb | 8 + .../v2/org-connections/ListOrgConnections.rb | 5 + .../org-connections/UpdateOrgConnections.rb | 21 + features/scenarios_model_mapping.rb | 10 + features/v2/given.json | 13 + features/v2/org_connections.feature | 95 ++++ features/v2/undo.json | 31 ++ lib/datadog_api_client/inflector.rb | 23 + .../v2/api/org_connections_api.rb | 290 +++++++++++++ .../v2/models/org_connection.rb | 186 ++++++++ .../v2/models/org_connection_attributes.rb | 146 +++++++ .../v2/models/org_connection_create.rb | 165 +++++++ .../org_connection_create_attributes.rb | 129 ++++++ .../org_connection_create_relationships.rb | 123 ++++++ .../models/org_connection_create_request.rb | 123 ++++++ .../v2/models/org_connection_list_response.rb | 135 ++++++ .../org_connection_list_response_meta.rb | 105 +++++ .../org_connection_list_response_meta_page.rb | 115 +++++ .../models/org_connection_org_relationship.rb | 105 +++++ .../org_connection_org_relationship_data.rb | 125 ++++++ ...g_connection_org_relationship_data_type.rb | 26 ++ .../v2/models/org_connection_relationships.rb | 125 ++++++ .../v2/models/org_connection_response.rb | 123 ++++++ .../v2/models/org_connection_type.rb | 26 ++ .../v2/models/org_connection_type_enum.rb | 27 ++ .../v2/models/org_connection_update.rb | 165 +++++++ .../org_connection_update_attributes.rb | 129 ++++++ .../models/org_connection_update_request.rb | 123 ++++++ .../org_connection_user_relationship.rb | 105 +++++ .../org_connection_user_relationship_data.rb | 125 ++++++ ..._connection_user_relationship_data_type.rb | 26 ++ 55 files changed, 3914 insertions(+) create mode 100644 cassettes/features/v2/org_connections/Create-Org-Connection-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/org_connections/Create-Org-Connection-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/org_connections/Create-Org-Connection-returns-Conflict-response.frozen create mode 100644 cassettes/features/v2/org_connections/Create-Org-Connection-returns-Conflict-response.yml create mode 100644 cassettes/features/v2/org_connections/Create-Org-Connection-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/org_connections/Create-Org-Connection-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/org_connections/Create-Org-Connection-returns-OK-response.frozen create mode 100644 cassettes/features/v2/org_connections/Create-Org-Connection-returns-OK-response.yml create mode 100644 cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/org_connections/Delete-Org-Connection-returns-OK-response.frozen create mode 100644 cassettes/features/v2/org_connections/Delete-Org-Connection-returns-OK-response.yml create mode 100644 cassettes/features/v2/org_connections/List-Org-Connections-returns-OK-response.frozen create mode 100644 cassettes/features/v2/org_connections/List-Org-Connections-returns-OK-response.yml create mode 100644 cassettes/features/v2/org_connections/Update-Org-Connection-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/org_connections/Update-Org-Connection-returns-Bad-Request-response.yml create mode 100644 cassettes/features/v2/org_connections/Update-Org-Connection-returns-Not-Found-response.frozen create mode 100644 cassettes/features/v2/org_connections/Update-Org-Connection-returns-Not-Found-response.yml create mode 100644 cassettes/features/v2/org_connections/Update-Org-Connection-returns-OK-response.frozen create mode 100644 cassettes/features/v2/org_connections/Update-Org-Connection-returns-OK-response.yml create mode 100644 examples/v2/org-connections/CreateOrgConnections.rb create mode 100644 examples/v2/org-connections/DeleteOrgConnections.rb create mode 100644 examples/v2/org-connections/ListOrgConnections.rb create mode 100644 examples/v2/org-connections/UpdateOrgConnections.rb create mode 100644 features/v2/org_connections.feature create mode 100644 lib/datadog_api_client/v2/api/org_connections_api.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_create.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_create_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_create_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_list_response.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_list_response_meta.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_list_response_meta_page.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_org_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_org_relationship_data.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_org_relationship_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_response.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_type.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_type_enum.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_update.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_update_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_user_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_user_relationship_data.rb create mode 100644 lib/datadog_api_client/v2/models/org_connection_user_relationship_data_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d40e489dc619..f48f49697877 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -681,6 +681,15 @@ components: schema: example: monitor_timezone type: string + OrgConnectionId: + description: The unique identifier of the org connection. + in: path + name: connection_id + required: true + schema: + example: f9ec96b0-8c8a-4b0a-9b0a-1b2c3d4e5f6a + format: uuid + type: string PageNumber: description: Specific page number to return. in: query @@ -30894,6 +30903,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: @@ -45726,6 +45984,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 @@ -58964,6 +59224,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, @@ -69333,6 +69735,11 @@ tags: externalDocs: url: https://docs.datadoghq.com/api/latest/opsgenie-integration name: Opsgenie Integration +- description: Manage connections between organizations. Org connections allow for + controlled sharing of data between different Datadog organizations. See the [Cross-Organization + Visibiltiy](https://docs.datadoghq.com/account_management/org_settings/cross_org_visibility/) + page for more information. + name: Org Connections - description: Create, edit, and manage your organizations. Read more about [multi-org accounts](https://docs.datadoghq.com/account_management/multi_organization). externalDocs: diff --git a/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Bad-Request-response.frozen b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..bdb5f4a2d218 --- /dev/null +++ b/cassettes/features/v2/org_connections/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/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Bad-Request-response.yml b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..21c788bab39e --- /dev/null +++ b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 20:19:35 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Conflict-response.frozen b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Conflict-response.frozen new file mode 100644 index 000000000000..6f07529abc1f --- /dev/null +++ b/cassettes/features/v2/org_connections/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/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Conflict-response.yml b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Conflict-response.yml new file mode 100644 index 000000000000..ec35107cec6a --- /dev/null +++ b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Conflict-response.yml @@ -0,0 +1,72 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 20:19:35 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 26 Aug 2025 20:19:35 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 26 Aug 2025 20:19:35 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/b5d3a360-d6e2-4af7-8da2-b2ff41b9f5e0 + response: + body: + encoding: UTF-8 + string: '{} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Not-Found-response.frozen b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..bdeeb5688d22 --- /dev/null +++ b/cassettes/features/v2/org_connections/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/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Not-Found-response.yml b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Not-Found-response.yml new file mode 100644 index 000000000000..4e128e73cf09 --- /dev/null +++ b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-Not-Found-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 20:19:35 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":["Not found"]} + + ' + headers: + Content-Type: + - application/json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/org_connections/Create-Org-Connection-returns-OK-response.frozen b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-OK-response.frozen new file mode 100644 index 000000000000..878b43f439fd --- /dev/null +++ b/cassettes/features/v2/org_connections/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/cassettes/features/v2/org_connections/Create-Org-Connection-returns-OK-response.yml b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-OK-response.yml new file mode 100644 index 000000000000..06b2a94995ee --- /dev/null +++ b/cassettes/features/v2/org_connections/Create-Org-Connection-returns-OK-response.yml @@ -0,0 +1,49 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 20:19:36 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 26 Aug 2025 20:19:36 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/40bbb1c2-32b2-4aa3-8a1a-5d93b5382e3d + response: + body: + encoding: UTF-8 + string: '{} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Bad-Request-response.frozen b/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..563493e1bffb --- /dev/null +++ b/cassettes/features/v2/org_connections/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/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Bad-Request-response.yml b/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..db257612f2a2 --- /dev/null +++ b/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Bad-Request-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 20:19:36 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/malformed_id + response: + body: + encoding: UTF-8 + string: '{"errors":["connection id must be a valid uuid"]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Not-Found-response.frozen b/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..908df97ed05f --- /dev/null +++ b/cassettes/features/v2/org_connections/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/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Not-Found-response.yml b/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Not-Found-response.yml new file mode 100644 index 000000000000..615f4f75d62b --- /dev/null +++ b/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 20:19:36 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/00000000-0000-0000-0000-000000000000 + response: + body: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-OK-response.frozen b/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-OK-response.frozen new file mode 100644 index 000000000000..a6ac9aae215f --- /dev/null +++ b/cassettes/features/v2/org_connections/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/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-OK-response.yml b/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-OK-response.yml new file mode 100644 index 000000000000..1fde332b2bc7 --- /dev/null +++ b/cassettes/features/v2/org_connections/Delete-Org-Connection-returns-OK-response.yml @@ -0,0 +1,68 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 20:19:36 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 26 Aug 2025 20:19:36 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/7b01f30c-6100-4cbf-b583-a5e353d7edb7 + response: + body: + encoding: UTF-8 + string: '{} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Tue, 26 Aug 2025 20:19:36 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/7b01f30c-6100-4cbf-b583-a5e353d7edb7 + response: + body: + encoding: UTF-8 + 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 +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/org_connections/List-Org-Connections-returns-OK-response.frozen b/cassettes/features/v2/org_connections/List-Org-Connections-returns-OK-response.frozen new file mode 100644 index 000000000000..feb7d7484cf1 --- /dev/null +++ b/cassettes/features/v2/org_connections/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/cassettes/features/v2/org_connections/List-Org-Connections-returns-OK-response.yml b/cassettes/features/v2/org_connections/List-Org-Connections-returns-OK-response.yml new file mode 100644 index 000000000000..92d378a747be --- /dev/null +++ b/cassettes/features/v2/org_connections/List-Org-Connections-returns-OK-response.yml @@ -0,0 +1,22 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 20:19:37 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/org_connections + response: + body: + encoding: UTF-8 + string: '{"data":[],"meta":{"page":{"total_count":0,"total_filtered_count":0}}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/org_connections/Update-Org-Connection-returns-Bad-Request-response.frozen b/cassettes/features/v2/org_connections/Update-Org-Connection-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..c28d682e610a --- /dev/null +++ b/cassettes/features/v2/org_connections/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/cassettes/features/v2/org_connections/Update-Org-Connection-returns-Bad-Request-response.yml b/cassettes/features/v2/org_connections/Update-Org-Connection-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..bab18dfb919d --- /dev/null +++ b/cassettes/features/v2/org_connections/Update-Org-Connection-returns-Bad-Request-response.yml @@ -0,0 +1,71 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 20:19:37 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 26 Aug 2025 20:19:37 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + string: '{"errors":["Validation failed for input."]}' + headers: + Content-Type: + - application/json + status: + code: 400 + message: Bad Request +- recorded_at: Tue, 26 Aug 2025 20:19:37 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/76e1a71f-81e5-40c8-b8e0-1b98265d26fe + response: + body: + encoding: UTF-8 + string: '{} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/org_connections/Update-Org-Connection-returns-Not-Found-response.frozen b/cassettes/features/v2/org_connections/Update-Org-Connection-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..742e61df8a6a --- /dev/null +++ b/cassettes/features/v2/org_connections/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/cassettes/features/v2/org_connections/Update-Org-Connection-returns-Not-Found-response.yml b/cassettes/features/v2/org_connections/Update-Org-Connection-returns-Not-Found-response.yml new file mode 100644 index 000000000000..2fbd89b3d93c --- /dev/null +++ b/cassettes/features/v2/org_connections/Update-Org-Connection-returns-Not-Found-response.yml @@ -0,0 +1,72 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 20:19:37 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 26 Aug 2025 20:19:37 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 26 Aug 2025 20:19:37 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/d348b9ab-c7cf-4298-83a6-b4762fafff5e + response: + body: + encoding: UTF-8 + string: '{} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/org_connections/Update-Org-Connection-returns-OK-response.frozen b/cassettes/features/v2/org_connections/Update-Org-Connection-returns-OK-response.frozen new file mode 100644 index 000000000000..291e5d534dc3 --- /dev/null +++ b/cassettes/features/v2/org_connections/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/cassettes/features/v2/org_connections/Update-Org-Connection-returns-OK-response.yml b/cassettes/features/v2/org_connections/Update-Org-Connection-returns-OK-response.yml new file mode 100644 index 000000000000..b96dcb733582 --- /dev/null +++ b/cassettes/features/v2/org_connections/Update-Org-Connection-returns-OK-response.yml @@ -0,0 +1,73 @@ +http_interactions: +- recorded_at: Tue, 26 Aug 2025 20:19:38 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 26 Aug 2025 20:19:38 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + encoding: UTF-8 + 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 +- recorded_at: Tue, 26 Aug 2025 20:19:38 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/org_connections/0105233a-4d7b-4c52-b364-cc968d003de0 + response: + body: + encoding: UTF-8 + string: '{} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/org-connections/CreateOrgConnections.rb b/examples/v2/org-connections/CreateOrgConnections.rb new file mode 100644 index 000000000000..4b5dc3c449fb --- /dev/null +++ b/examples/v2/org-connections/CreateOrgConnections.rb @@ -0,0 +1,24 @@ +# Create Org Connection returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgConnectionsAPI.new + +body = DatadogAPIClient::V2::OrgConnectionCreateRequest.new({ + data: DatadogAPIClient::V2::OrgConnectionCreate.new({ + type: DatadogAPIClient::V2::OrgConnectionType::ORG_CONNECTION, + relationships: DatadogAPIClient::V2::OrgConnectionCreateRelationships.new({ + sink_org: DatadogAPIClient::V2::OrgConnectionOrgRelationship.new({ + data: DatadogAPIClient::V2::OrgConnectionOrgRelationshipData.new({ + type: DatadogAPIClient::V2::OrgConnectionOrgRelationshipDataType::ORGS, + id: "83999dcd-7f97-11f0-8de1-1ecf66f1aa85", + }), + }), + }), + attributes: DatadogAPIClient::V2::OrgConnectionCreateAttributes.new({ + connection_types: [ + DatadogAPIClient::V2::OrgConnectionTypeEnum::LOGS, + ], + }), + }), +}) +p api_instance.create_org_connections(body) diff --git a/examples/v2/org-connections/DeleteOrgConnections.rb b/examples/v2/org-connections/DeleteOrgConnections.rb new file mode 100644 index 000000000000..d7d9406681a2 --- /dev/null +++ b/examples/v2/org-connections/DeleteOrgConnections.rb @@ -0,0 +1,8 @@ +# Delete Org Connection returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgConnectionsAPI.new + +# there is a valid "org_connection" in the system +ORG_CONNECTION_DATA_ID = ENV["ORG_CONNECTION_DATA_ID"] +p api_instance.delete_org_connections(ORG_CONNECTION_DATA_ID) diff --git a/examples/v2/org-connections/ListOrgConnections.rb b/examples/v2/org-connections/ListOrgConnections.rb new file mode 100644 index 000000000000..8f4dfb497339 --- /dev/null +++ b/examples/v2/org-connections/ListOrgConnections.rb @@ -0,0 +1,5 @@ +# List Org Connections returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgConnectionsAPI.new +p api_instance.list_org_connections() diff --git a/examples/v2/org-connections/UpdateOrgConnections.rb b/examples/v2/org-connections/UpdateOrgConnections.rb new file mode 100644 index 000000000000..9ba3e4b48cbf --- /dev/null +++ b/examples/v2/org-connections/UpdateOrgConnections.rb @@ -0,0 +1,21 @@ +# Update Org Connection returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::OrgConnectionsAPI.new + +# there is a valid "org_connection" in the system +ORG_CONNECTION_DATA_ID = ENV["ORG_CONNECTION_DATA_ID"] + +body = DatadogAPIClient::V2::OrgConnectionUpdateRequest.new({ + data: DatadogAPIClient::V2::OrgConnectionUpdate.new({ + type: DatadogAPIClient::V2::OrgConnectionType::ORG_CONNECTION, + id: ORG_CONNECTION_DATA_ID, + attributes: DatadogAPIClient::V2::OrgConnectionUpdateAttributes.new({ + connection_types: [ + DatadogAPIClient::V2::OrgConnectionTypeEnum::LOGS, + DatadogAPIClient::V2::OrgConnectionTypeEnum::METRICS, + ], + }), + }), +}) +p api_instance.update_org_connections(ORG_CONNECTION_DATA_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 93b43d1c1d96..d6e17dffe92f 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2261,6 +2261,16 @@ "v2.UploadIdPMetadata" => { "idp_file" => "File", }, + "v2.CreateOrgConnections" => { + "body" => "OrgConnectionCreateRequest", + }, + "v2.DeleteOrgConnections" => { + "connection_id" => "UUID", + }, + "v2.UpdateOrgConnections" => { + "connection_id" => "UUID", + "body" => "OrgConnectionUpdateRequest", + }, "v2.ListRoles" => { "page_size" => "Integer", "page_number" => "Integer", diff --git a/features/v2/given.json b/features/v2/given.json index fbeea567872f..f083a791765c 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -556,6 +556,19 @@ "tag": "On-Call", "operationId": "SetOnCallTeamRoutingRules" }, + { + "parameters": [ + { + "name": "body", + "origin": "request", + "value": "{\n \"data\": {\n \"type\": \"org_connection\",\n \"relationships\": {\n \"sink_org\": {\n \"data\": {\n \"type\": \"orgs\",\n \"id\": \"83999dcd-7f97-11f0-8de1-1ecf66f1aa85\"\n }\n }\n },\n \"attributes\": {\n \"connection_types\": [\"logs\"]\n }\n }\n}" + } + ], + "step": "there is a valid \"org_connection\" in the system", + "key": "org_connection", + "tag": "Org Connections", + "operationId": "CreateOrgConnections" + }, { "source": "data[4]", "step": "there is a valid \"permission\" in the system", diff --git a/features/v2/org_connections.feature b/features/v2/org_connections.feature new file mode 100644 index 000000000000..321e7c77f24c --- /dev/null +++ b/features/v2/org_connections.feature @@ -0,0 +1,95 @@ +@endpoint(org-connections) @endpoint(org-connections-v2) +Feature: Org Connections + Manage connections between organizations. Org connections allow for + controlled sharing of data between different Datadog organizations. See + the [Cross-Organization Visibiltiy](https://docs.datadoghq.com/account_man + agement/org_settings/cross_org_visibility/) page for more information. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "OrgConnections" API + + @team:DataDog/aaa-granular-access + Scenario: Create Org Connection returns "Bad Request" response + Given new "CreateOrgConnections" request + And body with value {"data": {"type": "org_connection", "relationships": {"sink_org": {"data": {"type": "orgs", "id": "83999dcd-7f97-11f0-8de1-1ecf66f1aa85"}}}, "attributes": {"connection_types": ["logs", "logs"]}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aaa-granular-access + Scenario: Create Org Connection returns "Conflict" response + Given there is a valid "org_connection" in the system + And new "CreateOrgConnections" request + And body with value {"data": {"type": "org_connection", "relationships": {"sink_org": {"data": {"type": "orgs", "id": "83999dcd-7f97-11f0-8de1-1ecf66f1aa85"}}}, "attributes": {"connection_types": ["logs"]}}} + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/aaa-granular-access + Scenario: Create Org Connection returns "Not Found" response + Given new "CreateOrgConnections" request + And body with value {"data": {"type": "org_connection", "relationships": {"sink_org": {"data": {"type": "orgs", "id": "nonexistent-org-id"}}}, "attributes": {"connection_types": ["logs"]}}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/aaa-granular-access + Scenario: Create Org Connection returns "OK" response + Given new "CreateOrgConnections" request + And body with value {"data": {"type": "org_connection", "relationships": {"sink_org": {"data": {"type": "orgs", "id": "83999dcd-7f97-11f0-8de1-1ecf66f1aa85"}}}, "attributes": {"connection_types": ["logs"]}}} + When the request is sent + Then the response status is 200 Created + + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/aaa-granular-access + Scenario: Delete Org Connection returns "Bad Request" response + Given new "DeleteOrgConnections" request + And request contains "connection_id" parameter with value "malformed_id" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aaa-granular-access + Scenario: Delete Org Connection returns "Not Found" response + Given new "DeleteOrgConnections" request + And request contains "connection_id" parameter with value "00000000-0000-0000-0000-000000000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/aaa-granular-access + Scenario: Delete Org Connection returns "OK" response + Given there is a valid "org_connection" in the system + And new "DeleteOrgConnections" request + And request contains "connection_id" parameter from "org_connection.data.id" + When the request is sent + Then the response status is 200 OK + + @team:DataDog/aaa-granular-access + Scenario: List Org Connections returns "OK" response + Given new "ListOrgConnections" request + When the request is sent + Then the response status is 200 OK + + @team:DataDog/aaa-granular-access + Scenario: Update Org Connection returns "Bad Request" response + Given there is a valid "org_connection" in the system + And new "UpdateOrgConnections" request + And request contains "connection_id" parameter from "org_connection.data.id" + And body with value {"data": {"type": "org_connection", "id": "{{ org_connection.data.id }}", "attributes": {"connection_types": ["logs", "logs"]}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/aaa-granular-access + Scenario: Update Org Connection returns "Not Found" response + Given there is a valid "org_connection" in the system + And new "UpdateOrgConnections" request + And request contains "connection_id" parameter with value "00000000-0000-0000-0000-000000000000" + And body with value {"data": {"type": "org_connection", "id": "00000000-0000-0000-0000-000000000000", "attributes": {"connection_types": ["logs", "metrics"]}}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/aaa-granular-access + Scenario: Update Org Connection returns "OK" response + Given there is a valid "org_connection" in the system + And new "UpdateOrgConnections" request + And request contains "connection_id" parameter from "org_connection.data.id" + And body with value {"data": {"type": "org_connection", "id": "{{ org_connection.data.id }}", "attributes": {"connection_types": ["logs", "metrics"]}}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index ec94e15e11da..d6587bfb7473 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2228,6 +2228,37 @@ "type": "idempotent" } }, + "ListOrgConnections": { + "tag": "Org Connections", + "undo": { + "type": "safe" + } + }, + "CreateOrgConnections": { + "tag": "Org Connections", + "undo": { + "operationId": "DeleteOrgConnections", + "parameters": [ + { + "name": "connection_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteOrgConnections": { + "tag": "Org Connections", + "undo": { + "type": "idempotent" + } + }, + "UpdateOrgConnections": { + "tag": "Org Connections", + "undo": { + "type": "idempotent" + } + }, "ListPermissions": { "tag": "Roles", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index d23ae42738fb..d4daa73c203a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2881,6 +2881,28 @@ def overrides "v2.org_config_write" => "OrgConfigWrite", "v2.org_config_write_attributes" => "OrgConfigWriteAttributes", "v2.org_config_write_request" => "OrgConfigWriteRequest", + "v2.org_connection" => "OrgConnection", + "v2.org_connection_attributes" => "OrgConnectionAttributes", + "v2.org_connection_create" => "OrgConnectionCreate", + "v2.org_connection_create_attributes" => "OrgConnectionCreateAttributes", + "v2.org_connection_create_relationships" => "OrgConnectionCreateRelationships", + "v2.org_connection_create_request" => "OrgConnectionCreateRequest", + "v2.org_connection_list_response" => "OrgConnectionListResponse", + "v2.org_connection_list_response_meta" => "OrgConnectionListResponseMeta", + "v2.org_connection_list_response_meta_page" => "OrgConnectionListResponseMetaPage", + "v2.org_connection_org_relationship" => "OrgConnectionOrgRelationship", + "v2.org_connection_org_relationship_data" => "OrgConnectionOrgRelationshipData", + "v2.org_connection_org_relationship_data_type" => "OrgConnectionOrgRelationshipDataType", + "v2.org_connection_relationships" => "OrgConnectionRelationships", + "v2.org_connection_response" => "OrgConnectionResponse", + "v2.org_connection_type" => "OrgConnectionType", + "v2.org_connection_type_enum" => "OrgConnectionTypeEnum", + "v2.org_connection_update" => "OrgConnectionUpdate", + "v2.org_connection_update_attributes" => "OrgConnectionUpdateAttributes", + "v2.org_connection_update_request" => "OrgConnectionUpdateRequest", + "v2.org_connection_user_relationship" => "OrgConnectionUserRelationship", + "v2.org_connection_user_relationship_data" => "OrgConnectionUserRelationshipData", + "v2.org_connection_user_relationship_data_type" => "OrgConnectionUserRelationshipDataType", "v2.outbound_edge" => "OutboundEdge", "v2.outcomes_batch_attributes" => "OutcomesBatchAttributes", "v2.outcomes_batch_request" => "OutcomesBatchRequest", @@ -3922,6 +3944,7 @@ def overrides "v2.on_call_api" => "OnCallAPI", "v2.on_call_paging_api" => "OnCallPagingAPI", "v2.opsgenie_integration_api" => "OpsgenieIntegrationAPI", + "v2.org_connections_api" => "OrgConnectionsAPI", "v2.organizations_api" => "OrganizationsAPI", "v2.powerpack_api" => "PowerpackAPI", "v2.processes_api" => "ProcessesAPI", diff --git a/lib/datadog_api_client/v2/api/org_connections_api.rb b/lib/datadog_api_client/v2/api/org_connections_api.rb new file mode 100644 index 000000000000..98d84facb41e --- /dev/null +++ b/lib/datadog_api_client/v2/api/org_connections_api.rb @@ -0,0 +1,290 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class OrgConnectionsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create Org Connection. + # + # @see #create_org_connections_with_http_info + def create_org_connections(body, opts = {}) + data, _status_code, _headers = create_org_connections_with_http_info(body, opts) + data + end + + # Create Org Connection. + # + # Create a new org connection between the current org and a target org. + # + # @param body [OrgConnectionCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(OrgConnectionResponse, Integer, Hash)>] OrgConnectionResponse data, response status code and response headers + def create_org_connections_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrgConnectionsAPI.create_org_connections ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling OrgConnectionsAPI.create_org_connections" + end + # resource path + local_var_path = '/api/v2/org_connections' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'OrgConnectionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_org_connections, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrgConnectionsAPI#create_org_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete Org Connection. + # + # @see #delete_org_connections_with_http_info + def delete_org_connections(connection_id, opts = {}) + delete_org_connections_with_http_info(connection_id, opts) + nil + end + + # Delete Org Connection. + # + # Delete an existing org connection. + # + # @param connection_id [UUID] The unique identifier of the org connection. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_org_connections_with_http_info(connection_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrgConnectionsAPI.delete_org_connections ...' + end + # verify the required parameter 'connection_id' is set + if @api_client.config.client_side_validation && connection_id.nil? + fail ArgumentError, "Missing the required parameter 'connection_id' when calling OrgConnectionsAPI.delete_org_connections" + end + # resource path + local_var_path = '/api/v2/org_connections/{connection_id}'.sub('{connection_id}', CGI.escape(connection_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_org_connections, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrgConnectionsAPI#delete_org_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List Org Connections. + # + # @see #list_org_connections_with_http_info + def list_org_connections(opts = {}) + data, _status_code, _headers = list_org_connections_with_http_info(opts) + data + end + + # List Org Connections. + # + # Returns a list of org connections. + # + # @param opts [Hash] the optional parameters + # @return [Array<(OrgConnectionListResponse, Integer, Hash)>] OrgConnectionListResponse data, response status code and response headers + def list_org_connections_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrgConnectionsAPI.list_org_connections ...' + end + # resource path + local_var_path = '/api/v2/org_connections' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'OrgConnectionListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_org_connections, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrgConnectionsAPI#list_org_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update Org Connection. + # + # @see #update_org_connections_with_http_info + def update_org_connections(connection_id, body, opts = {}) + data, _status_code, _headers = update_org_connections_with_http_info(connection_id, body, opts) + data + end + + # Update Org Connection. + # + # Update an existing org connection. + # + # @param connection_id [UUID] The unique identifier of the org connection. + # @param body [OrgConnectionUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(OrgConnectionResponse, Integer, Hash)>] OrgConnectionResponse data, response status code and response headers + def update_org_connections_with_http_info(connection_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: OrgConnectionsAPI.update_org_connections ...' + end + # verify the required parameter 'connection_id' is set + if @api_client.config.client_side_validation && connection_id.nil? + fail ArgumentError, "Missing the required parameter 'connection_id' when calling OrgConnectionsAPI.update_org_connections" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling OrgConnectionsAPI.update_org_connections" + end + # resource path + local_var_path = '/api/v2/org_connections/{connection_id}'.sub('{connection_id}', CGI.escape(connection_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'OrgConnectionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_org_connections, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: OrgConnectionsAPI#update_org_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection.rb b/lib/datadog_api_client/v2/models/org_connection.rb new file mode 100644 index 000000000000..88409e5eef13 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An org connection. + class OrgConnection + include BaseGenericModel + + # Org connection attributes. + attr_reader :attributes + + # The unique identifier of the org connection. + attr_reader :id + + # Related organizations and user. + attr_reader :relationships + + # Org connection type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OrgConnectionAttributes', + :'id' => :'UUID', + :'relationships' => :'OrgConnectionRelationships', + :'type' => :'OrgConnectionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnection` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_attributes.rb b/lib/datadog_api_client/v2/models/org_connection_attributes.rb new file mode 100644 index 000000000000..52475b4f0013 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_attributes.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Org connection attributes. + class OrgConnectionAttributes + include BaseGenericModel + + # List of connection types. + attr_reader :connection_types + + # Timestamp when the connection was created. + attr_reader :created_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'connection_types' => :'connection_types', + :'created_at' => :'created_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'connection_types' => :'Array', + :'created_at' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'connection_types') + if (value = attributes[:'connection_types']).is_a?(Array) + self.connection_types = value + end + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @connection_types.nil? + return false if @created_at.nil? + true + end + + # Custom attribute writer method with validation + # @param connection_types [Object] Object to be assigned + # @!visibility private + def connection_types=(connection_types) + if connection_types.nil? + fail ArgumentError, 'invalid value for "connection_types", connection_types cannot be nil.' + end + @connection_types = connection_types + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + connection_types == o.connection_types && + created_at == o.created_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [connection_types, created_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_create.rb b/lib/datadog_api_client/v2/models/org_connection_create.rb new file mode 100644 index 000000000000..eec8162b4936 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_create.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Org connection creation data. + class OrgConnectionCreate + include BaseGenericModel + + # Attributes for creating an org connection. + attr_reader :attributes + + # Relationships for org connection creation. + attr_reader :relationships + + # Org connection type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OrgConnectionCreateAttributes', + :'relationships' => :'OrgConnectionCreateRelationships', + :'type' => :'OrgConnectionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionCreate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_create_attributes.rb b/lib/datadog_api_client/v2/models/org_connection_create_attributes.rb new file mode 100644 index 000000000000..ad92ce82a4a3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_create_attributes.rb @@ -0,0 +1,129 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating an org connection. + class OrgConnectionCreateAttributes + include BaseGenericModel + + # List of connection types to establish. + attr_reader :connection_types + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'connection_types' => :'connection_types' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'connection_types' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'connection_types') + if (value = attributes[:'connection_types']).is_a?(Array) + self.connection_types = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @connection_types.nil? + return false if @connection_types.length < 1 + true + end + + # Custom attribute writer method with validation + # @param connection_types [Object] Object to be assigned + # @!visibility private + def connection_types=(connection_types) + if connection_types.nil? + fail ArgumentError, 'invalid value for "connection_types", connection_types cannot be nil.' + end + if connection_types.length < 1 + fail ArgumentError, 'invalid value for "connection_types", number of items must be greater than or equal to 1.' + end + @connection_types = connection_types + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + connection_types == o.connection_types && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [connection_types, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_create_relationships.rb b/lib/datadog_api_client/v2/models/org_connection_create_relationships.rb new file mode 100644 index 000000000000..e0c7142c6c15 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_create_relationships.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for org connection creation. + class OrgConnectionCreateRelationships + include BaseGenericModel + + # Org relationship. + attr_reader :sink_org + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'sink_org' => :'sink_org' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'sink_org' => :'OrgConnectionOrgRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionCreateRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'sink_org') + self.sink_org = attributes[:'sink_org'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @sink_org.nil? + true + end + + # Custom attribute writer method with validation + # @param sink_org [Object] Object to be assigned + # @!visibility private + def sink_org=(sink_org) + if sink_org.nil? + fail ArgumentError, 'invalid value for "sink_org", sink_org cannot be nil.' + end + @sink_org = sink_org + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + sink_org == o.sink_org && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [sink_org, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_create_request.rb b/lib/datadog_api_client/v2/models/org_connection_create_request.rb new file mode 100644 index 000000000000..e9719a11a6f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to create an org connection. + class OrgConnectionCreateRequest + include BaseGenericModel + + # Org connection creation data. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OrgConnectionCreate' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_list_response.rb b/lib/datadog_api_client/v2/models/org_connection_list_response.rb new file mode 100644 index 000000000000..ee9a20e19827 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_list_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of org connections. + class OrgConnectionListResponse + include BaseGenericModel + + # List of org connections. + attr_reader :data + + # Pagination metadata. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'OrgConnectionListResponseMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_list_response_meta.rb b/lib/datadog_api_client/v2/models/org_connection_list_response_meta.rb new file mode 100644 index 000000000000..0fac223a839b --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_list_response_meta.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination metadata. + class OrgConnectionListResponseMeta + include BaseGenericModel + + # Page information. + attr_accessor :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'OrgConnectionListResponseMetaPage' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionListResponseMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_list_response_meta_page.rb b/lib/datadog_api_client/v2/models/org_connection_list_response_meta_page.rb new file mode 100644 index 000000000000..b422bdc33f0f --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_list_response_meta_page.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Page information. + class OrgConnectionListResponseMetaPage + include BaseGenericModel + + # Total number of org connections. + attr_accessor :total_count + + # Total number of org connections matching the filter. + attr_accessor :total_filtered_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_count' => :'total_count', + :'total_filtered_count' => :'total_filtered_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_count' => :'Integer', + :'total_filtered_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionListResponseMetaPage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'total_count') + self.total_count = attributes[:'total_count'] + end + + if attributes.key?(:'total_filtered_count') + self.total_filtered_count = attributes[:'total_filtered_count'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_count == o.total_count && + total_filtered_count == o.total_filtered_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_count, total_filtered_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_org_relationship.rb b/lib/datadog_api_client/v2/models/org_connection_org_relationship.rb new file mode 100644 index 000000000000..3a4197151ce7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_org_relationship.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Org relationship. + class OrgConnectionOrgRelationship + include BaseGenericModel + + # The definition of `OrgConnectionOrgRelationshipData` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OrgConnectionOrgRelationshipData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionOrgRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_org_relationship_data.rb b/lib/datadog_api_client/v2/models/org_connection_org_relationship_data.rb new file mode 100644 index 000000000000..37f49963c7e6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_org_relationship_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of `OrgConnectionOrgRelationshipData` object. + class OrgConnectionOrgRelationshipData + include BaseGenericModel + + # Org UUID. + attr_accessor :id + + # Org name. + attr_accessor :name + + # The type of the organization relationship. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'type' => :'OrgConnectionOrgRelationshipDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionOrgRelationshipData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_org_relationship_data_type.rb b/lib/datadog_api_client/v2/models/org_connection_org_relationship_data_type.rb new file mode 100644 index 000000000000..ae4b68a927bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_org_relationship_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the organization relationship. + class OrgConnectionOrgRelationshipDataType + include BaseEnumModel + + ORGS = "orgs".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_relationships.rb b/lib/datadog_api_client/v2/models/org_connection_relationships.rb new file mode 100644 index 000000000000..c2b7562862ca --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_relationships.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Related organizations and user. + class OrgConnectionRelationships + include BaseGenericModel + + # User relationship. + attr_accessor :created_by + + # Org relationship. + attr_accessor :sink_org + + # Org relationship. + attr_accessor :source_org + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by' => :'created_by', + :'sink_org' => :'sink_org', + :'source_org' => :'source_org' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by' => :'OrgConnectionUserRelationship', + :'sink_org' => :'OrgConnectionOrgRelationship', + :'source_org' => :'OrgConnectionOrgRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'sink_org') + self.sink_org = attributes[:'sink_org'] + end + + if attributes.key?(:'source_org') + self.source_org = attributes[:'source_org'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by == o.created_by && + sink_org == o.sink_org && + source_org == o.source_org && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by, sink_org, source_org, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_response.rb b/lib/datadog_api_client/v2/models/org_connection_response.rb new file mode 100644 index 000000000000..0869e54bb8ef --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single org connection. + class OrgConnectionResponse + include BaseGenericModel + + # An org connection. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OrgConnection' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_type.rb b/lib/datadog_api_client/v2/models/org_connection_type.rb new file mode 100644 index 000000000000..5271b983ed54 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Org connection type. + class OrgConnectionType + include BaseEnumModel + + ORG_CONNECTION = "org_connection".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_type_enum.rb b/lib/datadog_api_client/v2/models/org_connection_type_enum.rb new file mode 100644 index 000000000000..f0aced09c324 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_type_enum.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Available connection types between organizations. + class OrgConnectionTypeEnum + include BaseEnumModel + + LOGS = "logs".freeze + METRICS = "metrics".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_update.rb b/lib/datadog_api_client/v2/models/org_connection_update.rb new file mode 100644 index 000000000000..25c167c9bd56 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_update.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Org connection update data. + class OrgConnectionUpdate + include BaseGenericModel + + # Attributes for updating an org connection. + attr_reader :attributes + + # The unique identifier of the org connection. + attr_reader :id + + # Org connection type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'OrgConnectionUpdateAttributes', + :'id' => :'UUID', + :'type' => :'OrgConnectionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionUpdate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_update_attributes.rb b/lib/datadog_api_client/v2/models/org_connection_update_attributes.rb new file mode 100644 index 000000000000..ad71b1486c33 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_update_attributes.rb @@ -0,0 +1,129 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating an org connection. + class OrgConnectionUpdateAttributes + include BaseGenericModel + + # Updated list of connection types. + attr_reader :connection_types + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'connection_types' => :'connection_types' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'connection_types' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'connection_types') + if (value = attributes[:'connection_types']).is_a?(Array) + self.connection_types = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @connection_types.nil? + return false if @connection_types.length < 1 + true + end + + # Custom attribute writer method with validation + # @param connection_types [Object] Object to be assigned + # @!visibility private + def connection_types=(connection_types) + if connection_types.nil? + fail ArgumentError, 'invalid value for "connection_types", connection_types cannot be nil.' + end + if connection_types.length < 1 + fail ArgumentError, 'invalid value for "connection_types", number of items must be greater than or equal to 1.' + end + @connection_types = connection_types + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + connection_types == o.connection_types && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [connection_types, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_update_request.rb b/lib/datadog_api_client/v2/models/org_connection_update_request.rb new file mode 100644 index 000000000000..db66ad671ebf --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request to update an org connection. + class OrgConnectionUpdateRequest + include BaseGenericModel + + # Org connection update data. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OrgConnectionUpdate' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_user_relationship.rb b/lib/datadog_api_client/v2/models/org_connection_user_relationship.rb new file mode 100644 index 000000000000..6898c0b2e543 --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_user_relationship.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # User relationship. + class OrgConnectionUserRelationship + include BaseGenericModel + + # The data for a user relationship. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'OrgConnectionUserRelationshipData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionUserRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_user_relationship_data.rb b/lib/datadog_api_client/v2/models/org_connection_user_relationship_data.rb new file mode 100644 index 000000000000..d032a3079dce --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_user_relationship_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data for a user relationship. + class OrgConnectionUserRelationshipData + include BaseGenericModel + + # User UUID. + attr_accessor :id + + # User name. + attr_accessor :name + + # The type of the user relationship. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'type' => :'OrgConnectionUserRelationshipDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgConnectionUserRelationshipData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/org_connection_user_relationship_data_type.rb b/lib/datadog_api_client/v2/models/org_connection_user_relationship_data_type.rb new file mode 100644 index 000000000000..56be6b6bc1af --- /dev/null +++ b/lib/datadog_api_client/v2/models/org_connection_user_relationship_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the user relationship. + class OrgConnectionUserRelationshipDataType + include BaseEnumModel + + USERS = "users".freeze + end +end