From ffa4b7ab9868236b58bc8dfa7fdc40ad1ec04272 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 7 Nov 2025 13:40:37 +0000 Subject: [PATCH] Regenerate client from commit fcc78bf of spec repo --- .generator/schemas/v2/openapi.yaml | 383 ++++++++++++++++++ .../team-connections/CreateTeamConnections.rb | 37 ++ .../team-connections/DeleteTeamConnections.rb | 17 + .../team-connections/ListTeamConnections.rb | 8 + .../ListTeamConnections_1473516764.rb | 14 + .../ListTeamConnections_2418873869.rb | 8 + features/scenarios_model_mapping.rb | 16 + features/v2/given.json | 7 + features/v2/team_connections.feature | 93 +++++ features/v2/undo.json | 19 + lib/datadog_api_client/configuration.rb | 3 + lib/datadog_api_client/inflector.rb | 18 + .../v2/api/team_connections_api.rb | 276 +++++++++++++ .../v2/models/connected_team_ref.rb | 105 +++++ .../v2/models/connected_team_ref_data.rb | 144 +++++++ .../v2/models/connected_team_ref_data_type.rb | 26 ++ .../v2/models/connections_page_pagination.rb | 184 +++++++++ .../v2/models/connections_response_meta.rb | 105 +++++ .../v2/models/team_connection.rb | 164 ++++++++ .../v2/models/team_connection_attributes.rb | 115 ++++++ .../v2/models/team_connection_create_data.rb | 143 +++++++ .../models/team_connection_create_request.rb | 125 ++++++ .../models/team_connection_delete_request.rb | 125 ++++++ ...eam_connection_delete_request_data_item.rb | 144 +++++++ .../models/team_connection_relationships.rb | 115 ++++++ .../v2/models/team_connection_type.rb | 26 ++ .../v2/models/team_connections_response.rb | 117 ++++++ lib/datadog_api_client/v2/models/team_ref.rb | 105 +++++ .../v2/models/team_ref_data.rb | 144 +++++++ .../v2/models/team_ref_data_type.rb | 26 ++ 30 files changed, 2812 insertions(+) create mode 100644 examples/v2/team-connections/CreateTeamConnections.rb create mode 100644 examples/v2/team-connections/DeleteTeamConnections.rb create mode 100644 examples/v2/team-connections/ListTeamConnections.rb create mode 100644 examples/v2/team-connections/ListTeamConnections_1473516764.rb create mode 100644 examples/v2/team-connections/ListTeamConnections_2418873869.rb create mode 100644 features/v2/team_connections.feature create mode 100644 lib/datadog_api_client/v2/api/team_connections_api.rb create mode 100644 lib/datadog_api_client/v2/models/connected_team_ref.rb create mode 100644 lib/datadog_api_client/v2/models/connected_team_ref_data.rb create mode 100644 lib/datadog_api_client/v2/models/connected_team_ref_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/connections_page_pagination.rb create mode 100644 lib/datadog_api_client/v2/models/connections_response_meta.rb create mode 100644 lib/datadog_api_client/v2/models/team_connection.rb create mode 100644 lib/datadog_api_client/v2/models/team_connection_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/team_connection_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/team_connection_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/team_connection_delete_request.rb create mode 100644 lib/datadog_api_client/v2/models/team_connection_delete_request_data_item.rb create mode 100644 lib/datadog_api_client/v2/models/team_connection_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/team_connection_type.rb create mode 100644 lib/datadog_api_client/v2/models/team_connections_response.rb create mode 100644 lib/datadog_api_client/v2/models/team_ref.rb create mode 100644 lib/datadog_api_client/v2/models/team_ref_data.rb create mode 100644 lib/datadog_api_client/v2/models/team_ref_data_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6ed4b42368e..ce755c7d444 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -11515,6 +11515,35 @@ components: $ref: '#/components/schemas/ConfluentResourceResponseData' type: array type: object + ConnectedTeamRef: + description: Reference to a team from an external system. + properties: + data: + $ref: '#/components/schemas/ConnectedTeamRefData' + type: object + ConnectedTeamRefData: + description: Reference to connected external team. + properties: + id: + description: The connected team ID as it is referenced throughout the Datadog + ecosystem. + example: '@MyGitHubAccount/my-team-name' + type: string + type: + $ref: '#/components/schemas/ConnectedTeamRefDataType' + required: + - id + - type + type: object + ConnectedTeamRefDataType: + default: github_team + description: External team resource type. + enum: + - github_team + example: github_team + type: string + x-enum-varnames: + - GITHUB_TEAM Connection: description: The definition of `Connection` object. properties: @@ -11579,6 +11608,50 @@ components: - label - tags type: object + ConnectionsPagePagination: + description: Page-based pagination metadata. + properties: + first_number: + description: The first page number. + format: int64 + type: integer + last_number: + description: The last page number. + format: int64 + type: integer + next_number: + description: The next page number. + format: int64 + nullable: true + type: integer + number: + description: The current page number. + format: int64 + type: integer + prev_number: + description: The previous page number. + format: int64 + nullable: true + type: integer + size: + description: The page size. + format: int64 + type: integer + total: + description: Total connections matching request. + format: int64 + type: integer + type: + description: Pagination type. + example: number_size + type: string + type: object + ConnectionsResponseMeta: + description: Connections response metadata. + properties: + page: + $ref: '#/components/schemas/ConnectionsPagePagination' + type: object Container: description: Container object. properties: @@ -51314,6 +51387,111 @@ components: - handle - name type: object + TeamConnection: + description: A relationship between a Datadog team and a team from another external + system. + properties: + attributes: + $ref: '#/components/schemas/TeamConnectionAttributes' + id: + description: The unique identifier of the team connection. + example: 12345678-1234-5678-9abc-123456789012 + type: string + relationships: + $ref: '#/components/schemas/TeamConnectionRelationships' + type: + $ref: '#/components/schemas/TeamConnectionType' + required: + - id + - type + type: object + TeamConnectionAttributes: + description: Attributes of the team connection. + properties: + managed_by: + description: The entity that manages this team connection. + example: github_sync + type: string + source: + description: The name of the external source. + example: github + type: string + type: object + TeamConnectionCreateData: + description: Data for creating a team connection. + properties: + attributes: + $ref: '#/components/schemas/TeamConnectionAttributes' + relationships: + $ref: '#/components/schemas/TeamConnectionRelationships' + type: + $ref: '#/components/schemas/TeamConnectionType' + required: + - type + type: object + TeamConnectionCreateRequest: + description: Request for creating team connections. + properties: + data: + description: Array of team connections to create. + items: + $ref: '#/components/schemas/TeamConnectionCreateData' + type: array + required: + - data + type: object + TeamConnectionDeleteRequest: + description: Request for deleting team connections. + properties: + data: + description: Array of team connection IDs to delete. + items: + $ref: '#/components/schemas/TeamConnectionDeleteRequestDataItem' + type: array + required: + - data + type: object + TeamConnectionDeleteRequestDataItem: + description: A collection of connection ids to delete. + properties: + id: + description: The unique identifier of the team connection to delete. + example: 12345678-1234-5678-9abc-123456789012 + type: string + type: + $ref: '#/components/schemas/TeamConnectionType' + required: + - id + - type + type: object + TeamConnectionRelationships: + description: Relationships of the team connection. + properties: + connected_team: + $ref: '#/components/schemas/ConnectedTeamRef' + team: + $ref: '#/components/schemas/TeamRef' + type: object + TeamConnectionType: + default: team_connection + description: Team connection resource type. + enum: + - team_connection + example: team_connection + type: string + x-enum-varnames: + - TEAM_CONNECTION + TeamConnectionsResponse: + description: Response containing information about multiple team connections. + properties: + data: + description: Array of team connections. + items: + $ref: '#/components/schemas/TeamConnection' + type: array + meta: + $ref: '#/components/schemas/ConnectionsResponseMeta' + type: object TeamCreate: description: Team create properties: @@ -51731,6 +51909,34 @@ components: $ref: '#/components/schemas/TeamPermissionSetting' type: array type: object + TeamRef: + description: Reference to a Datadog team. + properties: + data: + $ref: '#/components/schemas/TeamRefData' + type: object + TeamRefData: + description: Reference to a Datadog team. + properties: + id: + description: The Datadog team ID. + example: 87654321-4321-8765-dcba-210987654321 + type: string + type: + $ref: '#/components/schemas/TeamRefDataType' + required: + - id + - type + type: object + TeamRefDataType: + default: team + description: Datadog team resource type. + enum: + - team + example: team + type: string + x-enum-varnames: + - TEAM TeamReference: description: Provides a reference to a team, including ID, type, and basic attributes/relationships. properties: @@ -80747,6 +80953,180 @@ paths: permissions: - teams_read - teams_manage + /api/v2/team/connections: + delete: + description: Delete multiple team connections. + operationId: DeleteTeamConnections + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamConnectionDeleteRequest' + required: true + responses: + '204': + description: No Content + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Delete team connections + tags: + - Team Connections + x-permission: + operator: OR + permissions: + - teams_read + x-unstable: '**Note**: This endpoint is in Preview. To request access, fill + out this [form](https://www.datadoghq.com/product-preview/github-integration-for-teams/). + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Returns all team connections. + operationId: ListTeamConnections + parameters: + - $ref: '#/components/parameters/PageSize' + - $ref: '#/components/parameters/PageNumber' + - description: Specific offset to start retrieving results from. + in: query + name: page[offset] + required: false + schema: + format: int64 + type: integer + - description: Maximum number of results to return. + in: query + name: page[limit] + required: false + schema: + format: int64 + type: integer + - description: Filter team connections by external source systems. + explode: false + in: query + name: filter[sources] + required: false + schema: + items: + example: github + type: string + type: array + style: form + - description: Filter team connections by Datadog team IDs. + explode: false + in: query + name: filter[team_ids] + required: false + schema: + items: + example: 12345678-1234-5678-9abc-123456789012 + type: string + type: array + style: form + - description: Filter team connections by connected team IDs from external systems. + explode: false + in: query + name: filter[connected_team_ids] + required: false + schema: + items: + example: '@MyGitHubAccount/my-team-name' + type: string + type: array + style: form + - description: Filter team connections by connection IDs. + explode: false + in: query + name: filter[connection_ids] + required: false + schema: + items: + example: 12345678-1234-5678-9abc-123456789012 + type: string + type: array + style: form + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamConnectionsResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: List team connections + tags: + - Team Connections + x-pagination: + limitParam: page[size] + pageParam: page[number] + resultsPath: data + x-permission: + operator: OR + permissions: + - teams_read + x-unstable: '**Note**: This endpoint is in Preview. To request access, fill + out this [form](https://www.datadoghq.com/product-preview/github-integration-for-teams/). + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Create multiple team connections. + operationId: CreateTeamConnections + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/TeamConnectionCreateRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TeamConnectionsResponse' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '409': + $ref: '#/components/responses/ConflictResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - teams_read + summary: Create team connections + tags: + - Team Connections + x-permission: + operator: OR + permissions: + - teams_read + x-unstable: '**Note**: This endpoint is in Preview. To request access, fill + out this [form](https://www.datadoghq.com/product-preview/github-integration-for-teams/). + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/team/sync: post: description: 'This endpoint attempts to link your existing Datadog teams with @@ -83952,6 +84332,9 @@ tags: use Datadog\u2019s API to\nmanage both test types programmatically.\n\nFor more information about Synthetics, see the [Synthetics overview](https://docs.datadoghq.com/synthetics/)." name: Synthetics +- description: View and manage relationships between Datadog teams and teams from + external sources, such as GitHub. + name: Team Connections - description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information. name: Teams diff --git a/examples/v2/team-connections/CreateTeamConnections.rb b/examples/v2/team-connections/CreateTeamConnections.rb new file mode 100644 index 00000000000..6eeeb6b36ed --- /dev/null +++ b/examples/v2/team-connections/CreateTeamConnections.rb @@ -0,0 +1,37 @@ +# Create team connections returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_team_connections".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TeamConnectionsAPI.new + +# there is a valid "dd_team" in the system +DD_TEAM_DATA_ID = ENV["DD_TEAM_DATA_ID"] + +body = DatadogAPIClient::V2::TeamConnectionCreateRequest.new({ + data: [ + DatadogAPIClient::V2::TeamConnectionCreateData.new({ + type: DatadogAPIClient::V2::TeamConnectionType::TEAM_CONNECTION, + attributes: DatadogAPIClient::V2::TeamConnectionAttributes.new({ + source: "github", + managed_by: "datadog", + }), + relationships: DatadogAPIClient::V2::TeamConnectionRelationships.new({ + team: DatadogAPIClient::V2::TeamRef.new({ + data: DatadogAPIClient::V2::TeamRefData.new({ + id: DD_TEAM_DATA_ID, + type: DatadogAPIClient::V2::TeamRefDataType::TEAM, + }), + }), + connected_team: DatadogAPIClient::V2::ConnectedTeamRef.new({ + data: DatadogAPIClient::V2::ConnectedTeamRefData.new({ + id: "@MyGitHubAccount/my-team-name", + type: DatadogAPIClient::V2::ConnectedTeamRefDataType::GITHUB_TEAM, + }), + }), + }), + }), + ], +}) +p api_instance.create_team_connections(body) diff --git a/examples/v2/team-connections/DeleteTeamConnections.rb b/examples/v2/team-connections/DeleteTeamConnections.rb new file mode 100644 index 00000000000..3f2f68055bc --- /dev/null +++ b/examples/v2/team-connections/DeleteTeamConnections.rb @@ -0,0 +1,17 @@ +# Delete team connections returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_team_connections".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TeamConnectionsAPI.new + +body = DatadogAPIClient::V2::TeamConnectionDeleteRequest.new({ + data: [ + DatadogAPIClient::V2::TeamConnectionDeleteRequestDataItem.new({ + id: "12345678-1234-5678-9abc-123456789012", + type: DatadogAPIClient::V2::TeamConnectionType::TEAM_CONNECTION, + }), + ], +}) +api_instance.delete_team_connections(body) diff --git a/examples/v2/team-connections/ListTeamConnections.rb b/examples/v2/team-connections/ListTeamConnections.rb new file mode 100644 index 00000000000..6833cc55565 --- /dev/null +++ b/examples/v2/team-connections/ListTeamConnections.rb @@ -0,0 +1,8 @@ +# List team connections returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_team_connections".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TeamConnectionsAPI.new +p api_instance.list_team_connections() diff --git a/examples/v2/team-connections/ListTeamConnections_1473516764.rb b/examples/v2/team-connections/ListTeamConnections_1473516764.rb new file mode 100644 index 00000000000..cc3c645387c --- /dev/null +++ b/examples/v2/team-connections/ListTeamConnections_1473516764.rb @@ -0,0 +1,14 @@ +# List team connections with filters returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_team_connections".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TeamConnectionsAPI.new +opts = { + filter_sources: [ + "github", + ], + page_size: 10, +} +p api_instance.list_team_connections(opts) diff --git a/examples/v2/team-connections/ListTeamConnections_2418873869.rb b/examples/v2/team-connections/ListTeamConnections_2418873869.rb new file mode 100644 index 00000000000..31168ec1146 --- /dev/null +++ b/examples/v2/team-connections/ListTeamConnections_2418873869.rb @@ -0,0 +1,8 @@ +# List team connections returns "OK" response with pagination + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_team_connections".to_sym] = true +end +api_instance = DatadogAPIClient::V2::TeamConnectionsAPI.new +api_instance.list_team_connections_with_pagination() { |item| puts item } diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 3d5a33062ea..b4e494e5408 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3150,6 +3150,22 @@ "v2.GetUserMemberships" => { "user_uuid" => "String", }, + "v2.DeleteTeamConnections" => { + "body" => "TeamConnectionDeleteRequest", + }, + "v2.ListTeamConnections" => { + "page_size" => "Integer", + "page_number" => "Integer", + "page_offset" => "Integer", + "page_limit" => "Integer", + "filter_sources" => "Array", + "filter_team_ids" => "Array", + "filter_connected_team_ids" => "Array", + "filter_connection_ids" => "Array", + }, + "v2.CreateTeamConnections" => { + "body" => "TeamConnectionCreateRequest", + }, "v2.ListIncidentTeams" => { "include" => "IncidentRelatedObject", "page_size" => "Integer", diff --git a/features/v2/given.json b/features/v2/given.json index 12852be0f21..b67e2d5adcd 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1141,6 +1141,13 @@ "tag": "Teams", "operationId": "CreateTeam" }, + { + "source": "data.data[0]", + "step": "there is a valid \"team_connection\" in the system", + "key": "team_connection", + "tag": "Team Connections", + "operationId": "CreateTeamConnections" + }, { "parameters": [ { diff --git a/features/v2/team_connections.feature b/features/v2/team_connections.feature new file mode 100644 index 00000000000..49a0d92f5e6 --- /dev/null +++ b/features/v2/team_connections.feature @@ -0,0 +1,93 @@ +@endpoint(team-connections) @endpoint(team-connections-v2) +Feature: Team Connections + View and manage relationships between Datadog teams and teams from + external sources, such as GitHub. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "TeamConnections" API + + @skip @team:DataDog/aaa-omg + Scenario: Create team connections returns "Bad Request" response + Given operation "CreateTeamConnections" enabled + And new "CreateTeamConnections" request + And body with value {"data": [{"attributes": {"source": "github"}, "relationships": {"connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}, "team": {"data": {"type": "team"}}}, "type": "team_connection"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-omg + Scenario: Create team connections returns "Conflict" response + Given operation "CreateTeamConnections" enabled + And new "CreateTeamConnections" request + And body with value {"data": [{"attributes": {"managed_by": "github_sync", "source": "github"}, "relationships": {"connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}, "team": {"data": {"id": "87654321-4321-8765-dcba-210987654321", "type": "team"}}}, "type": "team_connection"}]} + When the request is sent + Then the response status is 409 Conflict + + @skip @team:DataDog/aaa-omg + Scenario: Create team connections returns "Created" response + Given operation "CreateTeamConnections" enabled + And new "CreateTeamConnections" request + And there is a valid "dd_team" in the system + And body with value {"data": [{"type": "team_connection", "attributes": {"source": "github", "managed_by": "datadog"}, "relationships": {"team": {"data": {"id": "{{ dd_team.data.id }}", "type": "team"}}, "connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}}}]} + When the request is sent + Then the response status is 201 Created + And the response "data.data[0].attributes.source" is equal to "github" + And the response "data.data[0].attributes.managed_by" is equal to "datadog" + And the response "data.data[0].relationships.team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data.data[0].relationships.connected_team.data.id" is equal to "@MyGitHubAccount/my-team-name" + And the response "data.data[0].type" is equal to "team_connection" + + @skip @team:DataDog/aaa-omg + Scenario: Delete team connections returns "Bad Request" response + Given operation "DeleteTeamConnections" enabled + And new "DeleteTeamConnections" request + And body with value {"data": [{"type": "team_connection"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-omg + Scenario: Delete team connections returns "No Content" response + Given operation "DeleteTeamConnections" enabled + And new "DeleteTeamConnections" request + And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/aaa-omg + Scenario: Delete team connections returns "Not Found" response + Given operation "DeleteTeamConnections" enabled + And new "DeleteTeamConnections" request + And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-omg + Scenario: List team connections returns "Bad Request" response + Given operation "ListTeamConnections" enabled + And new "ListTeamConnections" request + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/aaa-omg + Scenario: List team connections returns "OK" response + Given operation "ListTeamConnections" enabled + And new "ListTeamConnections" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-omg @with-pagination + Scenario: List team connections returns "OK" response with pagination + Given operation "ListTeamConnections" enabled + And new "ListTeamConnections" request + When the request with pagination is sent + Then the response status is 200 OK + + @skip @team:DataDog/aaa-omg + Scenario: List team connections with filters returns "OK" response + Given operation "ListTeamConnections" enabled + And new "ListTeamConnections" request + And request contains "filter[sources]" parameter with value ["github"] + And request contains "page[size]" parameter with value 10 + 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 cd8c18bf078..d25ca0a4dba 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4268,6 +4268,25 @@ "type": "unsafe" } }, + "DeleteTeamConnections": { + "tag": "Team Connections", + "undo": { + "type": "idempotent" + } + }, + "ListTeamConnections": { + "tag": "Team Connections", + "undo": { + "type": "safe" + } + }, + "CreateTeamConnections": { + "tag": "Team Connections", + "undo": { + "operationId": "DeleteTeamConnections", + "type": "unsafe" + } + }, "SyncTeams": { "tag": "Teams", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index c2ddc567e0f..353ed56095d 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -317,6 +317,9 @@ def initialize "v2.list_member_teams": false, "v2.remove_member_team": false, "v2.sync_teams": false, + "v2.create_team_connections": false, + "v2.delete_team_connections": false, + "v2.list_team_connections": false, "v2.create_incident_team": false, "v2.delete_incident_team": false, "v2.get_incident_team": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 32cc933e844..166d3435494 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1590,10 +1590,15 @@ def overrides "v2.confluent_resource_response_data" => "ConfluentResourceResponseData", "v2.confluent_resources_response" => "ConfluentResourcesResponse", "v2.confluent_resource_type" => "ConfluentResourceType", + "v2.connected_team_ref" => "ConnectedTeamRef", + "v2.connected_team_ref_data" => "ConnectedTeamRefData", + "v2.connected_team_ref_data_type" => "ConnectedTeamRefDataType", "v2.connection" => "Connection", "v2.connection_env" => "ConnectionEnv", "v2.connection_env_env" => "ConnectionEnvEnv", "v2.connection_group" => "ConnectionGroup", + "v2.connections_page_pagination" => "ConnectionsPagePagination", + "v2.connections_response_meta" => "ConnectionsResponseMeta", "v2.container" => "Container", "v2.container_attributes" => "ContainerAttributes", "v2.container_group" => "ContainerGroup", @@ -4170,6 +4175,15 @@ def overrides "v2.tag_filter" => "TagFilter", "v2.team" => "Team", "v2.team_attributes" => "TeamAttributes", + "v2.team_connection" => "TeamConnection", + "v2.team_connection_attributes" => "TeamConnectionAttributes", + "v2.team_connection_create_data" => "TeamConnectionCreateData", + "v2.team_connection_create_request" => "TeamConnectionCreateRequest", + "v2.team_connection_delete_request" => "TeamConnectionDeleteRequest", + "v2.team_connection_delete_request_data_item" => "TeamConnectionDeleteRequestDataItem", + "v2.team_connection_relationships" => "TeamConnectionRelationships", + "v2.team_connections_response" => "TeamConnectionsResponse", + "v2.team_connection_type" => "TeamConnectionType", "v2.team_create" => "TeamCreate", "v2.team_create_attributes" => "TeamCreateAttributes", "v2.team_create_relationships" => "TeamCreateRelationships", @@ -4203,6 +4217,9 @@ def overrides "v2.team_permission_setting_update_attributes" => "TeamPermissionSettingUpdateAttributes", "v2.team_permission_setting_update_request" => "TeamPermissionSettingUpdateRequest", "v2.team_permission_setting_value" => "TeamPermissionSettingValue", + "v2.team_ref" => "TeamRef", + "v2.team_ref_data" => "TeamRefData", + "v2.team_ref_data_type" => "TeamRefDataType", "v2.team_reference" => "TeamReference", "v2.team_reference_attributes" => "TeamReferenceAttributes", "v2.team_reference_type" => "TeamReferenceType", @@ -4561,6 +4578,7 @@ def overrides "v2.spans_metrics_api" => "SpansMetricsAPI", "v2.static_analysis_api" => "StaticAnalysisAPI", "v2.synthetics_api" => "SyntheticsAPI", + "v2.team_connections_api" => "TeamConnectionsAPI", "v2.teams_api" => "TeamsAPI", "v2.test_optimization_api" => "TestOptimizationAPI", "v2.usage_metering_api" => "UsageMeteringAPI", diff --git a/lib/datadog_api_client/v2/api/team_connections_api.rb b/lib/datadog_api_client/v2/api/team_connections_api.rb new file mode 100644 index 00000000000..c5a6eca18df --- /dev/null +++ b/lib/datadog_api_client/v2/api/team_connections_api.rb @@ -0,0 +1,276 @@ +=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 TeamConnectionsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create team connections. + # + # @see #create_team_connections_with_http_info + def create_team_connections(body, opts = {}) + data, _status_code, _headers = create_team_connections_with_http_info(body, opts) + data + end + + # Create team connections. + # + # Create multiple team connections. + # + # @param body [TeamConnectionCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(TeamConnectionsResponse, Integer, Hash)>] TeamConnectionsResponse data, response status code and response headers + def create_team_connections_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_team_connections".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_team_connections") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_team_connections")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamConnectionsAPI.create_team_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 TeamConnectionsAPI.create_team_connections" + end + # resource path + local_var_path = '/api/v2/team/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] || 'TeamConnectionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_team_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: TeamConnectionsAPI#create_team_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete team connections. + # + # @see #delete_team_connections_with_http_info + def delete_team_connections(body, opts = {}) + delete_team_connections_with_http_info(body, opts) + nil + end + + # Delete team connections. + # + # Delete multiple team connections. + # + # @param body [TeamConnectionDeleteRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_team_connections_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_team_connections".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_team_connections") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_team_connections")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamConnectionsAPI.delete_team_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 TeamConnectionsAPI.delete_team_connections" + end + # resource path + local_var_path = '/api/v2/team/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(['*/*']) + # 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] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_team_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: TeamConnectionsAPI#delete_team_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List team connections. + # + # @see #list_team_connections_with_http_info + def list_team_connections(opts = {}) + data, _status_code, _headers = list_team_connections_with_http_info(opts) + data + end + + # List team connections. + # + # Returns all team connections. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @option opts [Integer] :page_offset Specific offset to start retrieving results from. + # @option opts [Integer] :page_limit Maximum number of results to return. + # @option opts [Array] :filter_sources Filter team connections by external source systems. + # @option opts [Array] :filter_team_ids Filter team connections by Datadog team IDs. + # @option opts [Array] :filter_connected_team_ids Filter team connections by connected team IDs from external systems. + # @option opts [Array] :filter_connection_ids Filter team connections by connection IDs. + # @return [Array<(TeamConnectionsResponse, Integer, Hash)>] TeamConnectionsResponse data, response status code and response headers + def list_team_connections_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_team_connections".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_team_connections") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_team_connections")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TeamConnectionsAPI.list_team_connections ...' + end + # resource path + local_var_path = '/api/v2/team/connections' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil? + query_params[:'filter[sources]'] = @api_client.build_collection_param(opts[:'filter_sources'], :csv) if !opts[:'filter_sources'].nil? + query_params[:'filter[team_ids]'] = @api_client.build_collection_param(opts[:'filter_team_ids'], :csv) if !opts[:'filter_team_ids'].nil? + query_params[:'filter[connected_team_ids]'] = @api_client.build_collection_param(opts[:'filter_connected_team_ids'], :csv) if !opts[:'filter_connected_team_ids'].nil? + query_params[:'filter[connection_ids]'] = @api_client.build_collection_param(opts[:'filter_connection_ids'], :csv) if !opts[:'filter_connection_ids'].nil? + + # 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] || 'TeamConnectionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_team_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: TeamConnectionsAPI#list_team_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List team connections. + # + # Provide a paginated version of {#list_team_connections}, returning all items. + # + # To use it you need to use a block: list_team_connections_with_pagination { |item| p item } + # + # @yield [TeamConnection] Paginated items + def list_team_connections_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, 0) + while true do + response = list_team_connections(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_number", Integer, @api_client.get_attribute_from_path(opts, "page_number", 0) + 1) + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/connected_team_ref.rb b/lib/datadog_api_client/v2/models/connected_team_ref.rb new file mode 100644 index 00000000000..9d0ddbe4630 --- /dev/null +++ b/lib/datadog_api_client/v2/models/connected_team_ref.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 + # Reference to a team from an external system. + class ConnectedTeamRef + include BaseGenericModel + + # Reference to connected external team. + 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' => :'ConnectedTeamRefData' + } + 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::ConnectedTeamRef` 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/connected_team_ref_data.rb b/lib/datadog_api_client/v2/models/connected_team_ref_data.rb new file mode 100644 index 00000000000..9c049ae0ac1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/connected_team_ref_data.rb @@ -0,0 +1,144 @@ +=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 + # Reference to connected external team. + class ConnectedTeamRefData + include BaseGenericModel + + # The connected team ID as it is referenced throughout the Datadog ecosystem. + attr_reader :id + + # External team resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'ConnectedTeamRefDataType' + } + 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::ConnectedTeamRefData` 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?(:'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 @id.nil? + return false if @type.nil? + true + 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 && + 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 + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/connected_team_ref_data_type.rb b/lib/datadog_api_client/v2/models/connected_team_ref_data_type.rb new file mode 100644 index 00000000000..85633293979 --- /dev/null +++ b/lib/datadog_api_client/v2/models/connected_team_ref_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 + # External team resource type. + class ConnectedTeamRefDataType + include BaseEnumModel + + GITHUB_TEAM = "github_team".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/connections_page_pagination.rb b/lib/datadog_api_client/v2/models/connections_page_pagination.rb new file mode 100644 index 00000000000..64ce2051749 --- /dev/null +++ b/lib/datadog_api_client/v2/models/connections_page_pagination.rb @@ -0,0 +1,184 @@ +=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-based pagination metadata. + class ConnectionsPagePagination + include BaseGenericModel + + # The first page number. + attr_accessor :first_number + + # The last page number. + attr_accessor :last_number + + # The next page number. + attr_accessor :next_number + + # The current page number. + attr_accessor :number + + # The previous page number. + attr_accessor :prev_number + + # The page size. + attr_accessor :size + + # Total connections matching request. + attr_accessor :total + + # Pagination type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'first_number' => :'first_number', + :'last_number' => :'last_number', + :'next_number' => :'next_number', + :'number' => :'number', + :'prev_number' => :'prev_number', + :'size' => :'size', + :'total' => :'total', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'first_number' => :'Integer', + :'last_number' => :'Integer', + :'next_number' => :'Integer', + :'number' => :'Integer', + :'prev_number' => :'Integer', + :'size' => :'Integer', + :'total' => :'Integer', + :'type' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'next_number', + :'prev_number', + ]) + 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::ConnectionsPagePagination` 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?(:'first_number') + self.first_number = attributes[:'first_number'] + end + + if attributes.key?(:'last_number') + self.last_number = attributes[:'last_number'] + end + + if attributes.key?(:'next_number') + self.next_number = attributes[:'next_number'] + end + + if attributes.key?(:'number') + self.number = attributes[:'number'] + end + + if attributes.key?(:'prev_number') + self.prev_number = attributes[:'prev_number'] + end + + if attributes.key?(:'size') + self.size = attributes[:'size'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + 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 && + first_number == o.first_number && + last_number == o.last_number && + next_number == o.next_number && + number == o.number && + prev_number == o.prev_number && + size == o.size && + total == o.total && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [first_number, last_number, next_number, number, prev_number, size, total, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/connections_response_meta.rb b/lib/datadog_api_client/v2/models/connections_response_meta.rb new file mode 100644 index 00000000000..4ba7b89c652 --- /dev/null +++ b/lib/datadog_api_client/v2/models/connections_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 + # Connections response metadata. + class ConnectionsResponseMeta + include BaseGenericModel + + # Page-based pagination metadata. + 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' => :'ConnectionsPagePagination' + } + 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::ConnectionsResponseMeta` 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/team_connection.rb b/lib/datadog_api_client/v2/models/team_connection.rb new file mode 100644 index 00000000000..0a5a3878944 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_connection.rb @@ -0,0 +1,164 @@ +=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 + # A relationship between a Datadog team and a team from another external system. + class TeamConnection + include BaseGenericModel + + # Attributes of the team connection. + attr_accessor :attributes + + # The unique identifier of the team connection. + attr_reader :id + + # Relationships of the team connection. + attr_accessor :relationships + + # Team connection resource 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' => :'TeamConnectionAttributes', + :'id' => :'String', + :'relationships' => :'TeamConnectionRelationships', + :'type' => :'TeamConnectionType' + } + 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::TeamConnection` 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 @id.nil? + return false if @type.nil? + true + 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 && + 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/team_connection_attributes.rb b/lib/datadog_api_client/v2/models/team_connection_attributes.rb new file mode 100644 index 00000000000..d514c060e47 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_connection_attributes.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 + # Attributes of the team connection. + class TeamConnectionAttributes + include BaseGenericModel + + # The entity that manages this team connection. + attr_accessor :managed_by + + # The name of the external source. + attr_accessor :source + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'managed_by' => :'managed_by', + :'source' => :'source' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'managed_by' => :'String', + :'source' => :'String' + } + 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::TeamConnectionAttributes` 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?(:'managed_by') + self.managed_by = attributes[:'managed_by'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + 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 && + managed_by == o.managed_by && + source == o.source && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [managed_by, source, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_connection_create_data.rb b/lib/datadog_api_client/v2/models/team_connection_create_data.rb new file mode 100644 index 00000000000..f85dffd312f --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_connection_create_data.rb @@ -0,0 +1,143 @@ +=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 + # Data for creating a team connection. + class TeamConnectionCreateData + include BaseGenericModel + + # Attributes of the team connection. + attr_accessor :attributes + + # Relationships of the team connection. + attr_accessor :relationships + + # Team connection resource 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' => :'TeamConnectionAttributes', + :'relationships' => :'TeamConnectionRelationships', + :'type' => :'TeamConnectionType' + } + 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::TeamConnectionCreateData` 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 @type.nil? + true + 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/team_connection_create_request.rb b/lib/datadog_api_client/v2/models/team_connection_create_request.rb new file mode 100644 index 00000000000..98c04ae5359 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_connection_create_request.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 + # Request for creating team connections. + class TeamConnectionCreateRequest + include BaseGenericModel + + # Array of team connections to create. + 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' => :'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::TeamConnectionCreateRequest` 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 + 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/team_connection_delete_request.rb b/lib/datadog_api_client/v2/models/team_connection_delete_request.rb new file mode 100644 index 00000000000..562e745d003 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_connection_delete_request.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 + # Request for deleting team connections. + class TeamConnectionDeleteRequest + include BaseGenericModel + + # Array of team connection IDs to delete. + 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' => :'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::TeamConnectionDeleteRequest` 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 + 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/team_connection_delete_request_data_item.rb b/lib/datadog_api_client/v2/models/team_connection_delete_request_data_item.rb new file mode 100644 index 00000000000..bf5e3aea627 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_connection_delete_request_data_item.rb @@ -0,0 +1,144 @@ +=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 + # A collection of connection ids to delete. + class TeamConnectionDeleteRequestDataItem + include BaseGenericModel + + # The unique identifier of the team connection to delete. + attr_reader :id + + # Team connection resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'TeamConnectionType' + } + 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::TeamConnectionDeleteRequestDataItem` 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?(:'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 @id.nil? + return false if @type.nil? + true + 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 && + 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 + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_connection_relationships.rb b/lib/datadog_api_client/v2/models/team_connection_relationships.rb new file mode 100644 index 00000000000..4f6d9f8a28d --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_connection_relationships.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 + # Relationships of the team connection. + class TeamConnectionRelationships + include BaseGenericModel + + # Reference to a team from an external system. + attr_accessor :connected_team + + # Reference to a Datadog team. + attr_accessor :team + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'connected_team' => :'connected_team', + :'team' => :'team' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'connected_team' => :'ConnectedTeamRef', + :'team' => :'TeamRef' + } + 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::TeamConnectionRelationships` 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?(:'connected_team') + self.connected_team = attributes[:'connected_team'] + end + + if attributes.key?(:'team') + self.team = attributes[:'team'] + 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 && + connected_team == o.connected_team && + team == o.team && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [connected_team, team, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_connection_type.rb b/lib/datadog_api_client/v2/models/team_connection_type.rb new file mode 100644 index 00000000000..398c4846a40 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_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 + # Team connection resource type. + class TeamConnectionType + include BaseEnumModel + + TEAM_CONNECTION = "team_connection".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/team_connections_response.rb b/lib/datadog_api_client/v2/models/team_connections_response.rb new file mode 100644 index 00000000000..25d5c9da230 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_connections_response.rb @@ -0,0 +1,117 @@ +=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 information about multiple team connections. + class TeamConnectionsResponse + include BaseGenericModel + + # Array of team connections. + attr_accessor :data + + # Connections response 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' => :'ConnectionsResponseMeta' + } + 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::TeamConnectionsResponse` 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 + + # 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/team_ref.rb b/lib/datadog_api_client/v2/models/team_ref.rb new file mode 100644 index 00000000000..d5e817819d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_ref.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 + # Reference to a Datadog team. + class TeamRef + include BaseGenericModel + + # Reference to a Datadog team. + 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' => :'TeamRefData' + } + 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::TeamRef` 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/team_ref_data.rb b/lib/datadog_api_client/v2/models/team_ref_data.rb new file mode 100644 index 00000000000..af4d0b7d277 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_ref_data.rb @@ -0,0 +1,144 @@ +=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 + # Reference to a Datadog team. + class TeamRefData + include BaseGenericModel + + # The Datadog team ID. + attr_reader :id + + # Datadog team resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'TeamRefDataType' + } + 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::TeamRefData` 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?(:'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 @id.nil? + return false if @type.nil? + true + 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 && + 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 + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/team_ref_data_type.rb b/lib/datadog_api_client/v2/models/team_ref_data_type.rb new file mode 100644 index 00000000000..5709157c5b4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/team_ref_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 + # Datadog team resource type. + class TeamRefDataType + include BaseEnumModel + + TEAM = "team".freeze + end +end