From 507ed3b9a121192f293ae5b2697525e0b1f4405c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 13 Aug 2026 15:06:12 +0000 Subject: [PATCH] Regenerate client from commit 6cac40a of spec repo --- .generator/schemas/v2/openapi.yaml | 721 ++++++++++ .../CreateTeamsOwnershipMapping.java | 44 + ...reateTeamsOwnershipMapping_1881412984.java | 43 + .../CreateTeamsOwnershipMappingsBatch.java | 60 + .../DeleteTeamsOwnershipMapping.java | 22 + .../GetTeamsOwnershipMapping.java | 24 + .../ListTeamsOwnershipMappings.java | 24 + .../ListTeamsOwnershipRules.java | 24 + .../com/datadog/api/client/ApiClient.java | 6 + .../client/v2/api/RumTeamsOwnershipApi.java | 1175 +++++++++++++++++ .../TeamsOwnershipMappingBatchError.java | 202 +++ .../TeamsOwnershipMappingBatchOperation.java | 217 +++ ...amsOwnershipMappingBatchOperationData.java | 189 +++ ...ipMappingBatchOperationDataAttributes.java | 268 ++++ ...TeamsOwnershipMappingBatchOperationOp.java | 64 + ...eamsOwnershipMappingBatchOperationRef.java | 182 +++ .../TeamsOwnershipMappingBatchRequest.java | 167 +++ .../TeamsOwnershipMappingBatchResponse.java | 215 +++ .../TeamsOwnershipMappingBatchResult.java | 145 ++ .../TeamsOwnershipMappingBatchResultData.java | 215 +++ .../TeamsOwnershipMappingCreateData.java | 187 +++ ...sOwnershipMappingCreateDataAttributes.java | 269 ++++ .../TeamsOwnershipMappingCreateRequest.java | 151 +++ .../model/TeamsOwnershipMappingResponse.java | 150 +++ ...amsOwnershipMappingResponseAttributes.java | 364 +++++ .../TeamsOwnershipMappingResponseData.java | 215 +++ .../v2/model/TeamsOwnershipMappingType.java | 57 + .../model/TeamsOwnershipMappingsResponse.java | 198 +++ .../v2/model/TeamsOwnershipMatchType.java | 57 + .../TeamsOwnershipRuleResponseAttributes.java | 290 ++++ .../model/TeamsOwnershipRuleResponseData.java | 217 +++ .../model/TeamsOwnershipRuleTeamMapping.java | 174 +++ .../v2/model/TeamsOwnershipRuleType.java | 57 + .../v2/model/TeamsOwnershipRulesResponse.java | 197 +++ .../client/v2/api/rum_teams_ownership.feature | 127 ++ .../com/datadog/api/client/v2/api/undo.json | 45 + 36 files changed, 6762 insertions(+) create mode 100644 examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping.java create mode 100644 examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping_1881412984.java create mode 100644 examples/v2/rum-teams-ownership/CreateTeamsOwnershipMappingsBatch.java create mode 100644 examples/v2/rum-teams-ownership/DeleteTeamsOwnershipMapping.java create mode 100644 examples/v2/rum-teams-ownership/GetTeamsOwnershipMapping.java create mode 100644 examples/v2/rum-teams-ownership/ListTeamsOwnershipMappings.java create mode 100644 examples/v2/rum-teams-ownership/ListTeamsOwnershipRules.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/RumTeamsOwnershipApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchError.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperation.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationOp.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationRef.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResult.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResultData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMatchType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleTeamMapping.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRulesResponse.java create mode 100644 src/test/resources/com/datadog/api/client/v2/api/rum_teams_ownership.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a5b1012c5d2..729e373ca02 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1997,6 +1997,46 @@ components: required: true schema: type: string + TeamsOwnershipFilterApplicationIdParameter: + description: Filter mappings by RUM application ID. Each value must be a valid UUID. + in: query + name: filter[application_id] + schema: + items: + format: uuid + type: string + type: array + TeamsOwnershipFilterServiceParameter: + description: Filter mappings by RUM application service name. + in: query + name: filter[service] + schema: + items: + type: string + type: array + TeamsOwnershipFilterTeamHandleParameter: + description: Filter mappings by owning team handle. + in: query + name: filter[team_handle] + schema: + items: + type: string + type: array + TeamsOwnershipFilterViewNameParameter: + description: Filter mappings by RUM view name. + in: query + name: filter[view_name] + schema: + items: + type: string + type: array + TeamsOwnershipMappingIdParameter: + description: The ID of the teams ownership mapping. + in: path + name: id + required: true + schema: + type: string ToTimestamp: description: The ending timestamp for the SLO status query in epoch seconds. in: query @@ -112863,6 +112903,390 @@ components: example: "number_size" type: string type: object + TeamsOwnershipMappingBatchError: + description: An error encountered while validating or applying an operation. + properties: + detail: + description: A human-readable explanation specific to this error. + example: "prefix match_type is not enabled for this org" + type: string + status: + description: The HTTP status code applicable to this error. + example: "400" + type: string + title: + description: A short, human-readable summary of the error. + example: "Bad Request" + type: string + required: + - status + - title + type: object + TeamsOwnershipMappingBatchOperation: + description: A single add or remove operation, applied atomically with every other operation in the request. + properties: + data: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchOperationData" + op: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchOperationOp" + ref: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchOperationRef" + required: + - op + type: object + TeamsOwnershipMappingBatchOperationData: + description: The mapping to add. Required when `op` is `add`. + properties: + attributes: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchOperationDataAttributes" + type: + $ref: "#/components/schemas/TeamsOwnershipMappingType" + required: + - type + - attributes + type: object + TeamsOwnershipMappingBatchOperationDataAttributes: + description: |- + The attributes of the mapping to add. `team_handle` and `view_name` are required + when `op` is `add`. + properties: + application_id: + description: |- + The ID of the RUM application this mapping applies to. + For browser applications, provide the real application UUID — the team is applied to the view regardless of service. + For mobile applications, omit this field (or set it to the nil UUID `00000000-0000-0000-0000-000000000000`) — the team is applied to the view and service combination across all applications. + example: "11111111-2222-3333-4444-555555555555" + format: uuid + type: string + match_type: + $ref: "#/components/schemas/TeamsOwnershipMatchType" + service: + description: The RUM application's service name. For browser applications, this is optional. For mobile applications, this is required and scopes the ownership to a specific service. + example: "web-checkout" + type: string + team_handle: + description: The handle of the team that owns the matched RUM views. + example: "team-rum" + type: string + view_name: + description: The RUM view name to match, or its prefix when `match_type` is `prefix`. + example: "/checkout" + type: string + type: object + TeamsOwnershipMappingBatchOperationOp: + description: Whether this operation adds a new mapping or removes an existing one. + enum: + - add + - remove + example: add + type: string + x-enum-varnames: ["ADD", "REMOVE"] + TeamsOwnershipMappingBatchOperationRef: + description: Identifies an existing mapping to remove. Required when `op` is `remove`. + properties: + id: + description: The ID of the mapping to remove. + example: "456" + type: string + type: + $ref: "#/components/schemas/TeamsOwnershipMappingType" + required: + - type + - id + type: object + TeamsOwnershipMappingBatchRequest: + description: The request body for bulk-creating and bulk-removing teams ownership mappings. + properties: + atomic:operations: + description: The ordered list of add and remove operations to apply atomically. + items: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchOperation" + type: array + required: + - atomic:operations + type: object + TeamsOwnershipMappingBatchResponse: + description: |- + The response body for the bulk create and remove operation. On success, `atomic:results` + contains one entry per operation, in request order. On failure, no operations were applied + and `errors` describes what went wrong. + properties: + atomic:results: + description: |- + The result of each operation. + Add operations are processed first, then remove operations, so results may not appear + in the same order as the request. Present only on success. + items: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchResult" + type: array + errors: + description: The validation or processing errors encountered. Present only when the request could not be completed. + items: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchError" + type: array + type: object + TeamsOwnershipMappingBatchResult: + description: |- + The result of a single operation. + Add operations are processed first, then remove operations, so results may not appear + in the same order as the request. Empty for `remove` operations. + properties: + data: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchResultData" + type: object + TeamsOwnershipMappingBatchResultData: + description: The mapping created by an `add` operation. + properties: + attributes: + $ref: "#/components/schemas/TeamsOwnershipMappingResponseAttributes" + id: + description: The unique identifier of the teams ownership mapping. + example: "123" + type: string + type: + $ref: "#/components/schemas/TeamsOwnershipMappingType" + required: + - type + - id + - attributes + type: object + TeamsOwnershipMappingCreateData: + description: The JSON:API data envelope for a teams ownership mapping create request. + properties: + attributes: + $ref: "#/components/schemas/TeamsOwnershipMappingCreateDataAttributes" + type: + $ref: "#/components/schemas/TeamsOwnershipMappingType" + required: + - type + - attributes + type: object + TeamsOwnershipMappingCreateDataAttributes: + description: The attributes of the teams ownership mapping to create. + properties: + application_id: + description: |- + The ID of the RUM application this mapping applies to. + For browser applications, provide the real application UUID — the team is applied to the view regardless of service. + For mobile applications, omit this field (or set it to the nil UUID `00000000-0000-0000-0000-000000000000`) — the team is applied to the view and service combination across all applications. + example: "11111111-2222-3333-4444-555555555555" + format: uuid + type: string + match_type: + $ref: "#/components/schemas/TeamsOwnershipMatchType" + service: + description: The RUM application's service name. For browser applications, this is optional. For mobile applications, this is required and scopes the ownership to a specific service. + example: "web-checkout" + type: string + team_handle: + description: The handle of the team that owns the matched RUM views. + example: "team-rum" + type: string + view_name: + description: The RUM view name to match, or its prefix when `match_type` is `prefix`. + example: "/checkout" + type: string + required: + - team_handle + - view_name + type: object + TeamsOwnershipMappingCreateRequest: + description: The request body for creating a teams ownership mapping. + properties: + data: + $ref: "#/components/schemas/TeamsOwnershipMappingCreateData" + required: + - data + type: object + TeamsOwnershipMappingResponse: + description: The response body for a single teams ownership mapping. + properties: + data: + $ref: "#/components/schemas/TeamsOwnershipMappingResponseData" + required: + - data + type: object + TeamsOwnershipMappingResponseAttributes: + description: The attributes of a teams ownership mapping. + properties: + application_id: + description: |- + The ID of the RUM application this mapping applies to. + For browser applications, this is the real application UUID. + For mobile applications, this is the nil UUID `00000000-0000-0000-0000-000000000000` (wildcard), meaning the ownership applies across all applications. + example: "11111111-2222-3333-4444-555555555555" + type: string + created_at: + description: Timestamp when the mapping was created. + example: "2026-01-15T09:30:00.000Z" + format: date-time + type: string + created_by: + description: The UUID of the user who created the mapping. + example: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + type: string + match_type: + $ref: "#/components/schemas/TeamsOwnershipMatchType" + org_id: + description: The ID of the organization that owns this mapping. + example: 123456 + format: int64 + type: integer + service: + description: The RUM application's service name. For browser applications, may be empty. For mobile applications, this is the service that scopes the ownership. + example: "web-checkout" + type: string + team_handle: + description: The handle of the team that owns the matched RUM views. + example: "team-rum" + type: string + view_name: + description: The RUM view name to match, or its prefix when `match_type` is `prefix`. + example: "/checkout" + type: string + required: + - team_handle + - view_name + - service + - application_id + - org_id + - created_at + - created_by + - match_type + type: object + TeamsOwnershipMappingResponseData: + description: The JSON:API data envelope for a teams ownership mapping. + properties: + attributes: + $ref: "#/components/schemas/TeamsOwnershipMappingResponseAttributes" + id: + description: The unique identifier of the teams ownership mapping. + example: "123" + type: string + type: + $ref: "#/components/schemas/TeamsOwnershipMappingType" + required: + - id + - type + - attributes + type: object + TeamsOwnershipMappingType: + default: teams_ownership_mappings + description: The type of the resource. The value should always be teams_ownership_mappings. + enum: + - teams_ownership_mappings + example: teams_ownership_mappings + type: string + x-enum-varnames: ["TEAMS_OWNERSHIP_MAPPINGS"] + TeamsOwnershipMappingsResponse: + description: The response body for a list of teams ownership mappings. + properties: + data: + description: A list of teams ownership mappings. + items: + $ref: "#/components/schemas/TeamsOwnershipMappingResponseData" + type: array + meta: + $ref: "#/components/schemas/ResponseMetaAttributes" + required: + - data + type: object + TeamsOwnershipMatchType: + default: exact + description: How the `view_name` is matched against RUM view names. + enum: + - exact + - prefix + example: exact + type: string + x-enum-varnames: ["EXACT", "PREFIX"] + TeamsOwnershipRuleResponseAttributes: + description: The attributes of a teams ownership rule. + properties: + application_id: + description: |- + The ID of the RUM application this mapping applies to. + For browser applications, this is the real application UUID. + For mobile applications, this is the nil UUID `00000000-0000-0000-0000-000000000000` (wildcard), meaning the ownership applies across all applications. + example: "11111111-2222-3333-4444-555555555555" + type: string + match_type: + $ref: "#/components/schemas/TeamsOwnershipMatchType" + service: + description: The RUM application's service name. For browser applications, may be empty. For mobile applications, this is the service that scopes the ownership. + example: "web-checkout" + type: string + teams: + description: The teams that own the matched views, each paired with the ID of its underlying mapping. + items: + $ref: "#/components/schemas/TeamsOwnershipRuleTeamMapping" + type: array + view_name: + description: The RUM view name to match, or its prefix when `match_type` is `prefix`. + example: "/checkout" + type: string + required: + - teams + - view_name + - service + - application_id + - match_type + type: object + TeamsOwnershipRuleResponseData: + description: The JSON:API data envelope for a teams ownership rule. + properties: + attributes: + $ref: "#/components/schemas/TeamsOwnershipRuleResponseAttributes" + id: + description: |- + A deterministic identifier derived from the rule's grouping key. + This ID cannot be used to delete the rule directly; delete individual mappings + using the `mapping_id` under `teams` instead. + example: "3b1e2f7a9c4d6e8f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f" + type: string + type: + $ref: "#/components/schemas/TeamsOwnershipRuleType" + required: + - id + - type + - attributes + type: object + TeamsOwnershipRuleTeamMapping: + description: An individual team's ownership entry within a teams ownership rule. + properties: + mapping_id: + description: The ID of the underlying mapping, used to delete this team's ownership individually. + example: "123" + type: string + team_handle: + description: The handle of the owning team. + example: "team-rum" + type: string + required: + - team_handle + - mapping_id + type: object + TeamsOwnershipRuleType: + default: teams_ownership_grouped_mappings + description: The type of the resource. The value should always be teams_ownership_grouped_mappings. + enum: + - teams_ownership_grouped_mappings + example: teams_ownership_grouped_mappings + type: string + x-enum-varnames: ["TEAMS_OWNERSHIP_GROUPED_MAPPINGS"] + TeamsOwnershipRulesResponse: + description: The response body for a list of teams ownership rules. + properties: + data: + description: A list of teams ownership rules. + items: + $ref: "#/components/schemas/TeamsOwnershipRuleResponseData" + type: array + meta: + $ref: "#/components/schemas/ResponseMetaAttributes" + required: + - data + type: object TeamsResponse: description: Response with multiple teams properties: @@ -183423,6 +183847,299 @@ paths: tags: - Rum Metrics x-codegen-request-body-name: body + /api/v2/rum/config/teams-ownership/mappings: + get: + description: Get the list of teams ownership mappings for your organization, optionally filtered. + operationId: ListTeamsOwnershipMappings + parameters: + - $ref: "#/components/parameters/TeamsOwnershipFilterViewNameParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterTeamHandleParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterApplicationIdParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterServiceParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + application_id: "11111111-2222-3333-4444-555555555555" + created_at: "2026-01-15T09:30:00.000Z" + created_by: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + match_type: "exact" + org_id: 123456 + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + id: "123" + type: teams_ownership_mappings + meta: + page: + total_count: 1 + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingsResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List teams ownership mappings + tags: + - Rum Teams Ownership + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: |- + Create a teams ownership mapping for your organization. + Returns the teams ownership mapping object from the request body when the request is successful. + operationId: CreateTeamsOwnershipMapping + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + application_id: "11111111-2222-3333-4444-555555555555" + match_type: "exact" + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + type: teams_ownership_mappings + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingCreateRequest" + description: The definition of the teams ownership mapping to create. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + application_id: "11111111-2222-3333-4444-555555555555" + created_at: "2026-01-15T09:30:00.000Z" + created_by: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + match_type: "exact" + org_id: 123456 + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + id: "123" + type: teams_ownership_mappings + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a teams ownership mapping + tags: + - Rum Teams Ownership + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/rum/config/teams-ownership/mappings/operations: + post: + description: |- + Add and remove teams ownership mappings for your organization in a single atomic request, following + the JSON:API [atomic operations extension](https://jsonapi.org/ext/atomic/). + Operations are applied together: if any operation is invalid, none of the operations are applied. + Add operations are processed before remove operations, so results may not appear in the same + order as the request. + operationId: CreateTeamsOwnershipMappingsBatch + requestBody: + content: + application/json: + examples: + default: + value: + atomic:operations: + - data: + attributes: + application_id: "11111111-2222-3333-4444-555555555555" + match_type: "exact" + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + type: teams_ownership_mappings + op: add + - op: remove + ref: + id: "456" + type: teams_ownership_mappings + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchRequest" + description: The ordered list of add and remove operations to apply atomically. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + atomic:results: + - data: + attributes: + application_id: "11111111-2222-3333-4444-555555555555" + created_at: "2026-01-15T09:30:00.000Z" + created_by: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + match_type: "exact" + org_id: 123456 + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + id: "123" + type: teams_ownership_mappings + - {} + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingBatchResponse" + description: OK + "400": + content: + application/json: + examples: + default: + value: + errors: + - detail: "prefix match_type is not enabled for this org" + status: "400" + title: "Bad Request" + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: |- + Bad Request. One or more operations failed validation, so none of the operations were applied. + Errors are returned in the JSON:API atomic operations error format rather than the standard error response. + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Bulk create and remove teams ownership mappings + tags: + - Rum Teams Ownership + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/rum/config/teams-ownership/mappings/{id}: + delete: + description: Delete a specific teams ownership mapping from your organization. + operationId: DeleteTeamsOwnershipMapping + parameters: + - $ref: "#/components/parameters/TeamsOwnershipMappingIdParameter" + responses: + "204": + description: No Content + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a teams ownership mapping + tags: + - Rum Teams Ownership + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get a specific teams ownership mapping from your organization. + operationId: GetTeamsOwnershipMapping + parameters: + - $ref: "#/components/parameters/TeamsOwnershipMappingIdParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + application_id: "11111111-2222-3333-4444-555555555555" + created_at: "2026-01-15T09:30:00.000Z" + created_by: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee" + match_type: "exact" + org_id: 123456 + service: "web-checkout" + team_handle: "team-rum" + view_name: "/checkout" + id: "123" + type: teams_ownership_mappings + schema: + $ref: "#/components/schemas/TeamsOwnershipMappingResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a teams ownership mapping + tags: + - Rum Teams Ownership + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/rum/config/teams-ownership/rules: + get: + description: |- + Get the list of teams ownership rules for your organization, optionally filtered. + Rules group the underlying mappings by `view_name`, `application_id`, `service`, and `match_type`, + collapsing every team that owns the same view into a single entry. + operationId: ListTeamsOwnershipRules + parameters: + - $ref: "#/components/parameters/TeamsOwnershipFilterViewNameParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterTeamHandleParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterApplicationIdParameter" + - $ref: "#/components/parameters/TeamsOwnershipFilterServiceParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + application_id: "11111111-2222-3333-4444-555555555555" + match_type: "exact" + service: "web-checkout" + teams: + - mapping_id: "123" + team_handle: "team-rum" + view_name: "/checkout" + id: "3b1e2f7a9c4d6e8f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f" + type: teams_ownership_grouped_mappings + meta: + page: + total_count: 1 + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/TeamsOwnershipRulesResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List teams ownership rules + tags: + - Rum Teams Ownership + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/rum/events: get: description: |- @@ -213932,6 +214649,10 @@ tags: - description: |- Manage retention filters through [Manage Applications](https://app.datadoghq.com/rum/list) of RUM for your organization. name: Rum Retention Filters + - description: |- + Manage [teams ownership](https://docs.datadoghq.com/real_user_monitoring/platform/ownership/) mappings + between RUM views and the teams that own them. + name: Rum Teams Ownership - description: |- Configure your [Datadog Salesforce integration](https://docs.datadoghq.com/integrations/salesforce/) directly through the Datadog API. diff --git a/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping.java b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping.java new file mode 100644 index 00000000000..dcf97f250b4 --- /dev/null +++ b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping.java @@ -0,0 +1,44 @@ +// Create a teams ownership mapping returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumTeamsOwnershipApi; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingCreateData; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingCreateDataAttributes; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingCreateRequest; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingResponse; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingType; +import com.datadog.api.client.v2.model.TeamsOwnershipMatchType; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createTeamsOwnershipMapping", true); + RumTeamsOwnershipApi apiInstance = new RumTeamsOwnershipApi(defaultClient); + + TeamsOwnershipMappingCreateRequest body = + new TeamsOwnershipMappingCreateRequest() + .data( + new TeamsOwnershipMappingCreateData() + .attributes( + new TeamsOwnershipMappingCreateDataAttributes() + .applicationId(UUID.fromString("11111111-2222-3333-4444-555555555555")) + .matchType(TeamsOwnershipMatchType.EXACT) + .service("web-checkout") + .teamHandle("team-rum") + .viewName("/checkout")) + .type(TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS)); + + try { + TeamsOwnershipMappingResponse result = apiInstance.createTeamsOwnershipMapping(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RumTeamsOwnershipApi#createTeamsOwnershipMapping"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping_1881412984.java b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping_1881412984.java new file mode 100644 index 00000000000..7733eb19c36 --- /dev/null +++ b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping_1881412984.java @@ -0,0 +1,43 @@ +// Create teams ownership mapping returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumTeamsOwnershipApi; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingCreateData; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingCreateDataAttributes; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingCreateRequest; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingResponse; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingType; +import com.datadog.api.client.v2.model.TeamsOwnershipMatchType; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumTeamsOwnershipApi apiInstance = new RumTeamsOwnershipApi(defaultClient); + + TeamsOwnershipMappingCreateRequest body = + new TeamsOwnershipMappingCreateRequest() + .data( + new TeamsOwnershipMappingCreateData() + .type(TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS) + .attributes( + new TeamsOwnershipMappingCreateDataAttributes() + .teamHandle("team-rum") + .viewName("/checkout") + .service("web-checkout") + .applicationId(UUID.fromString("11111111-2222-3333-4444-555555555555")) + .matchType(TeamsOwnershipMatchType.EXACT))); + + try { + TeamsOwnershipMappingResponse result = apiInstance.createTeamsOwnershipMapping(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RumTeamsOwnershipApi#createTeamsOwnershipMapping"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMappingsBatch.java b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMappingsBatch.java new file mode 100644 index 00000000000..61c740a80a0 --- /dev/null +++ b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMappingsBatch.java @@ -0,0 +1,60 @@ +// Bulk create and remove teams ownership mappings returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumTeamsOwnershipApi; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchOperation; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchOperationData; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchOperationDataAttributes; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchOperationOp; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchOperationRef; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchRequest; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchResponse; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingType; +import com.datadog.api.client.v2.model.TeamsOwnershipMatchType; +import java.util.Arrays; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumTeamsOwnershipApi apiInstance = new RumTeamsOwnershipApi(defaultClient); + + TeamsOwnershipMappingBatchRequest body = + new TeamsOwnershipMappingBatchRequest() + .atomicOperations( + Arrays.asList( + new TeamsOwnershipMappingBatchOperation() + .op(TeamsOwnershipMappingBatchOperationOp.ADD) + .data( + new TeamsOwnershipMappingBatchOperationData() + .type(TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS) + .attributes( + new TeamsOwnershipMappingBatchOperationDataAttributes() + .teamHandle("team-rum") + .viewName("/checkout") + .service("web-checkout") + .applicationId( + UUID.fromString("11111111-2222-3333-4444-555555555555")) + .matchType(TeamsOwnershipMatchType.EXACT))), + new TeamsOwnershipMappingBatchOperation() + .op(TeamsOwnershipMappingBatchOperationOp.REMOVE) + .ref( + new TeamsOwnershipMappingBatchOperationRef() + .type(TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS) + .id("456")))); + + try { + TeamsOwnershipMappingBatchResponse result = + apiInstance.createTeamsOwnershipMappingsBatch(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling RumTeamsOwnershipApi#createTeamsOwnershipMappingsBatch"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-teams-ownership/DeleteTeamsOwnershipMapping.java b/examples/v2/rum-teams-ownership/DeleteTeamsOwnershipMapping.java new file mode 100644 index 00000000000..b3d47bb50eb --- /dev/null +++ b/examples/v2/rum-teams-ownership/DeleteTeamsOwnershipMapping.java @@ -0,0 +1,22 @@ +// Delete a teams ownership mapping returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumTeamsOwnershipApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumTeamsOwnershipApi apiInstance = new RumTeamsOwnershipApi(defaultClient); + + try { + apiInstance.deleteTeamsOwnershipMapping("123"); + } catch (ApiException e) { + System.err.println("Exception when calling RumTeamsOwnershipApi#deleteTeamsOwnershipMapping"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-teams-ownership/GetTeamsOwnershipMapping.java b/examples/v2/rum-teams-ownership/GetTeamsOwnershipMapping.java new file mode 100644 index 00000000000..9aeb8b5e338 --- /dev/null +++ b/examples/v2/rum-teams-ownership/GetTeamsOwnershipMapping.java @@ -0,0 +1,24 @@ +// Get a teams ownership mapping returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumTeamsOwnershipApi; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumTeamsOwnershipApi apiInstance = new RumTeamsOwnershipApi(defaultClient); + + try { + TeamsOwnershipMappingResponse result = apiInstance.getTeamsOwnershipMapping("123"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RumTeamsOwnershipApi#getTeamsOwnershipMapping"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-teams-ownership/ListTeamsOwnershipMappings.java b/examples/v2/rum-teams-ownership/ListTeamsOwnershipMappings.java new file mode 100644 index 00000000000..12ef25fa9f7 --- /dev/null +++ b/examples/v2/rum-teams-ownership/ListTeamsOwnershipMappings.java @@ -0,0 +1,24 @@ +// List teams ownership mappings returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumTeamsOwnershipApi; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumTeamsOwnershipApi apiInstance = new RumTeamsOwnershipApi(defaultClient); + + try { + TeamsOwnershipMappingsResponse result = apiInstance.listTeamsOwnershipMappings(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RumTeamsOwnershipApi#listTeamsOwnershipMappings"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/rum-teams-ownership/ListTeamsOwnershipRules.java b/examples/v2/rum-teams-ownership/ListTeamsOwnershipRules.java new file mode 100644 index 00000000000..8d1a5c9cc26 --- /dev/null +++ b/examples/v2/rum-teams-ownership/ListTeamsOwnershipRules.java @@ -0,0 +1,24 @@ +// List teams ownership rules returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.RumTeamsOwnershipApi; +import com.datadog.api.client.v2.model.TeamsOwnershipRulesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + RumTeamsOwnershipApi apiInstance = new RumTeamsOwnershipApi(defaultClient); + + try { + TeamsOwnershipRulesResponse result = apiInstance.listTeamsOwnershipRules(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling RumTeamsOwnershipApi#listTeamsOwnershipRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 0d8443e0d1a..7c028c0dbff 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1321,6 +1321,12 @@ public class ApiClient { put("v2.createRumConfig", false); put("v2.getRumConfig", false); put("v2.updateRumConfig", false); + put("v2.createTeamsOwnershipMapping", false); + put("v2.createTeamsOwnershipMappingsBatch", false); + put("v2.deleteTeamsOwnershipMapping", false); + put("v2.getTeamsOwnershipMapping", false); + put("v2.listTeamsOwnershipMappings", false); + put("v2.listTeamsOwnershipRules", false); put("v2.createRUMOperation", false); put("v2.createRUMOperationStrongLink", false); put("v2.deleteRUMOperation", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/RumTeamsOwnershipApi.java b/src/main/java/com/datadog/api/client/v2/api/RumTeamsOwnershipApi.java new file mode 100644 index 00000000000..06c88dfe8f9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/RumTeamsOwnershipApi.java @@ -0,0 +1,1175 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchRequest; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingBatchResponse; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingCreateRequest; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingResponse; +import com.datadog.api.client.v2.model.TeamsOwnershipMappingsResponse; +import com.datadog.api.client.v2.model.TeamsOwnershipRulesResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RumTeamsOwnershipApi { + private ApiClient apiClient; + + public RumTeamsOwnershipApi() { + this(ApiClient.getDefaultApiClient()); + } + + public RumTeamsOwnershipApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create a teams ownership mapping. + * + *

See {@link #createTeamsOwnershipMappingWithHttpInfo}. + * + * @param body The definition of the teams ownership mapping to create. (required) + * @return TeamsOwnershipMappingResponse + * @throws ApiException if fails to make API call + */ + public TeamsOwnershipMappingResponse createTeamsOwnershipMapping( + TeamsOwnershipMappingCreateRequest body) throws ApiException { + return createTeamsOwnershipMappingWithHttpInfo(body).getData(); + } + + /** + * Create a teams ownership mapping. + * + *

See {@link #createTeamsOwnershipMappingWithHttpInfoAsync}. + * + * @param body The definition of the teams ownership mapping to create. (required) + * @return CompletableFuture<TeamsOwnershipMappingResponse> + */ + public CompletableFuture createTeamsOwnershipMappingAsync( + TeamsOwnershipMappingCreateRequest body) { + return createTeamsOwnershipMappingWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a teams ownership mapping for your organization. Returns the teams ownership mapping + * object from the request body when the request is successful. + * + * @param body The definition of the teams ownership mapping to create. (required) + * @return ApiResponse<TeamsOwnershipMappingResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse createTeamsOwnershipMappingWithHttpInfo( + TeamsOwnershipMappingCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createTeamsOwnershipMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createTeamsOwnershipMapping"); + } + // create path and map variables + String localVarPath = "/api/v2/rum/config/teams-ownership/mappings"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.createTeamsOwnershipMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a teams ownership mapping. + * + *

See {@link #createTeamsOwnershipMappingWithHttpInfo}. + * + * @param body The definition of the teams ownership mapping to create. (required) + * @return CompletableFuture<ApiResponse<TeamsOwnershipMappingResponse>> + */ + public CompletableFuture> + createTeamsOwnershipMappingWithHttpInfoAsync(TeamsOwnershipMappingCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createTeamsOwnershipMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling createTeamsOwnershipMapping")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/rum/config/teams-ownership/mappings"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.createTeamsOwnershipMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Bulk create and remove teams ownership mappings. + * + *

See {@link #createTeamsOwnershipMappingsBatchWithHttpInfo}. + * + * @param body The ordered list of add and remove operations to apply atomically. (required) + * @return TeamsOwnershipMappingBatchResponse + * @throws ApiException if fails to make API call + */ + public TeamsOwnershipMappingBatchResponse createTeamsOwnershipMappingsBatch( + TeamsOwnershipMappingBatchRequest body) throws ApiException { + return createTeamsOwnershipMappingsBatchWithHttpInfo(body).getData(); + } + + /** + * Bulk create and remove teams ownership mappings. + * + *

See {@link #createTeamsOwnershipMappingsBatchWithHttpInfoAsync}. + * + * @param body The ordered list of add and remove operations to apply atomically. (required) + * @return CompletableFuture<TeamsOwnershipMappingBatchResponse> + */ + public CompletableFuture + createTeamsOwnershipMappingsBatchAsync(TeamsOwnershipMappingBatchRequest body) { + return createTeamsOwnershipMappingsBatchWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Add and remove teams ownership mappings for your organization in a single atomic request, + * following the JSON:API atomic operations + * extension. Operations are applied together: if any operation is invalid, none of the + * operations are applied. Add operations are processed before remove operations, so results may + * not appear in the same order as the request. + * + * @param body The ordered list of add and remove operations to apply atomically. (required) + * @return ApiResponse<TeamsOwnershipMappingBatchResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request. One or more operations failed validation, so none of the operations were applied. Errors are returned in the JSON:API atomic operations error format rather than the standard error response. -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse + createTeamsOwnershipMappingsBatchWithHttpInfo(TeamsOwnershipMappingBatchRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createTeamsOwnershipMappingsBatch"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling createTeamsOwnershipMappingsBatch"); + } + // create path and map variables + String localVarPath = "/api/v2/rum/config/teams-ownership/mappings/operations"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.createTeamsOwnershipMappingsBatch", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Bulk create and remove teams ownership mappings. + * + *

See {@link #createTeamsOwnershipMappingsBatchWithHttpInfo}. + * + * @param body The ordered list of add and remove operations to apply atomically. (required) + * @return CompletableFuture<ApiResponse<TeamsOwnershipMappingBatchResponse>> + */ + public CompletableFuture> + createTeamsOwnershipMappingsBatchWithHttpInfoAsync(TeamsOwnershipMappingBatchRequest body) { + // Check if unstable operation is enabled + String operationId = "createTeamsOwnershipMappingsBatch"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " createTeamsOwnershipMappingsBatch")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/rum/config/teams-ownership/mappings/operations"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.createTeamsOwnershipMappingsBatch", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete a teams ownership mapping. + * + *

See {@link #deleteTeamsOwnershipMappingWithHttpInfo}. + * + * @param id The ID of the teams ownership mapping. (required) + * @throws ApiException if fails to make API call + */ + public void deleteTeamsOwnershipMapping(String id) throws ApiException { + deleteTeamsOwnershipMappingWithHttpInfo(id); + } + + /** + * Delete a teams ownership mapping. + * + *

See {@link #deleteTeamsOwnershipMappingWithHttpInfoAsync}. + * + * @param id The ID of the teams ownership mapping. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteTeamsOwnershipMappingAsync(String id) { + return deleteTeamsOwnershipMappingWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Delete a specific teams ownership mapping from your organization. + * + * @param id The ID of the teams ownership mapping. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteTeamsOwnershipMappingWithHttpInfo(String id) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteTeamsOwnershipMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling deleteTeamsOwnershipMapping"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/config/teams-ownership/mappings/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.deleteTeamsOwnershipMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a teams ownership mapping. + * + *

See {@link #deleteTeamsOwnershipMappingWithHttpInfo}. + * + * @param id The ID of the teams ownership mapping. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteTeamsOwnershipMappingWithHttpInfoAsync( + String id) { + // Check if unstable operation is enabled + String operationId = "deleteTeamsOwnershipMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling deleteTeamsOwnershipMapping")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/config/teams-ownership/mappings/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.deleteTeamsOwnershipMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get a teams ownership mapping. + * + *

See {@link #getTeamsOwnershipMappingWithHttpInfo}. + * + * @param id The ID of the teams ownership mapping. (required) + * @return TeamsOwnershipMappingResponse + * @throws ApiException if fails to make API call + */ + public TeamsOwnershipMappingResponse getTeamsOwnershipMapping(String id) throws ApiException { + return getTeamsOwnershipMappingWithHttpInfo(id).getData(); + } + + /** + * Get a teams ownership mapping. + * + *

See {@link #getTeamsOwnershipMappingWithHttpInfoAsync}. + * + * @param id The ID of the teams ownership mapping. (required) + * @return CompletableFuture<TeamsOwnershipMappingResponse> + */ + public CompletableFuture getTeamsOwnershipMappingAsync(String id) { + return getTeamsOwnershipMappingWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a specific teams ownership mapping from your organization. + * + * @param id The ID of the teams ownership mapping. (required) + * @return ApiResponse<TeamsOwnershipMappingResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getTeamsOwnershipMappingWithHttpInfo(String id) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getTeamsOwnershipMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling getTeamsOwnershipMapping"); + } + // create path and map variables + String localVarPath = + "/api/v2/rum/config/teams-ownership/mappings/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.getTeamsOwnershipMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a teams ownership mapping. + * + *

See {@link #getTeamsOwnershipMappingWithHttpInfo}. + * + * @param id The ID of the teams ownership mapping. (required) + * @return CompletableFuture<ApiResponse<TeamsOwnershipMappingResponse>> + */ + public CompletableFuture> + getTeamsOwnershipMappingWithHttpInfoAsync(String id) { + // Check if unstable operation is enabled + String operationId = "getTeamsOwnershipMapping"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling getTeamsOwnershipMapping")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/rum/config/teams-ownership/mappings/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.getTeamsOwnershipMapping", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listTeamsOwnershipMappings. */ + public static class ListTeamsOwnershipMappingsOptionalParameters { + private List filterViewName; + private List filterTeamHandle; + private List filterApplicationId; + private List filterService; + + /** + * Set filterViewName. + * + * @param filterViewName Filter mappings by RUM view name. (optional) + * @return ListTeamsOwnershipMappingsOptionalParameters + */ + public ListTeamsOwnershipMappingsOptionalParameters filterViewName( + List filterViewName) { + this.filterViewName = filterViewName; + return this; + } + + /** + * Set filterTeamHandle. + * + * @param filterTeamHandle Filter mappings by owning team handle. (optional) + * @return ListTeamsOwnershipMappingsOptionalParameters + */ + public ListTeamsOwnershipMappingsOptionalParameters filterTeamHandle( + List filterTeamHandle) { + this.filterTeamHandle = filterTeamHandle; + return this; + } + + /** + * Set filterApplicationId. + * + * @param filterApplicationId Filter mappings by RUM application ID. Each value must be a valid + * UUID. (optional) + * @return ListTeamsOwnershipMappingsOptionalParameters + */ + public ListTeamsOwnershipMappingsOptionalParameters filterApplicationId( + List filterApplicationId) { + this.filterApplicationId = filterApplicationId; + return this; + } + + /** + * Set filterService. + * + * @param filterService Filter mappings by RUM application service name. (optional) + * @return ListTeamsOwnershipMappingsOptionalParameters + */ + public ListTeamsOwnershipMappingsOptionalParameters filterService(List filterService) { + this.filterService = filterService; + return this; + } + } + + /** + * List teams ownership mappings. + * + *

See {@link #listTeamsOwnershipMappingsWithHttpInfo}. + * + * @return TeamsOwnershipMappingsResponse + * @throws ApiException if fails to make API call + */ + public TeamsOwnershipMappingsResponse listTeamsOwnershipMappings() throws ApiException { + return listTeamsOwnershipMappingsWithHttpInfo( + new ListTeamsOwnershipMappingsOptionalParameters()) + .getData(); + } + + /** + * List teams ownership mappings. + * + *

See {@link #listTeamsOwnershipMappingsWithHttpInfoAsync}. + * + * @return CompletableFuture<TeamsOwnershipMappingsResponse> + */ + public CompletableFuture listTeamsOwnershipMappingsAsync() { + return listTeamsOwnershipMappingsWithHttpInfoAsync( + new ListTeamsOwnershipMappingsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List teams ownership mappings. + * + *

See {@link #listTeamsOwnershipMappingsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return TeamsOwnershipMappingsResponse + * @throws ApiException if fails to make API call + */ + public TeamsOwnershipMappingsResponse listTeamsOwnershipMappings( + ListTeamsOwnershipMappingsOptionalParameters parameters) throws ApiException { + return listTeamsOwnershipMappingsWithHttpInfo(parameters).getData(); + } + + /** + * List teams ownership mappings. + * + *

See {@link #listTeamsOwnershipMappingsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<TeamsOwnershipMappingsResponse> + */ + public CompletableFuture listTeamsOwnershipMappingsAsync( + ListTeamsOwnershipMappingsOptionalParameters parameters) { + return listTeamsOwnershipMappingsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the list of teams ownership mappings for your organization, optionally filtered. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<TeamsOwnershipMappingsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse listTeamsOwnershipMappingsWithHttpInfo( + ListTeamsOwnershipMappingsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listTeamsOwnershipMappings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + List filterViewName = parameters.filterViewName; + List filterTeamHandle = parameters.filterTeamHandle; + List filterApplicationId = parameters.filterApplicationId; + List filterService = parameters.filterService; + // create path and map variables + String localVarPath = "/api/v2/rum/config/teams-ownership/mappings"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[view_name]", filterViewName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[team_handle]", filterTeamHandle)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[application_id]", filterApplicationId)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[service]", filterService)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.listTeamsOwnershipMappings", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List teams ownership mappings. + * + *

See {@link #listTeamsOwnershipMappingsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<TeamsOwnershipMappingsResponse>> + */ + public CompletableFuture> + listTeamsOwnershipMappingsWithHttpInfoAsync( + ListTeamsOwnershipMappingsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listTeamsOwnershipMappings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + List filterViewName = parameters.filterViewName; + List filterTeamHandle = parameters.filterTeamHandle; + List filterApplicationId = parameters.filterApplicationId; + List filterService = parameters.filterService; + // create path and map variables + String localVarPath = "/api/v2/rum/config/teams-ownership/mappings"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[view_name]", filterViewName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[team_handle]", filterTeamHandle)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[application_id]", filterApplicationId)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[service]", filterService)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.listTeamsOwnershipMappings", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listTeamsOwnershipRules. */ + public static class ListTeamsOwnershipRulesOptionalParameters { + private List filterViewName; + private List filterTeamHandle; + private List filterApplicationId; + private List filterService; + + /** + * Set filterViewName. + * + * @param filterViewName Filter mappings by RUM view name. (optional) + * @return ListTeamsOwnershipRulesOptionalParameters + */ + public ListTeamsOwnershipRulesOptionalParameters filterViewName(List filterViewName) { + this.filterViewName = filterViewName; + return this; + } + + /** + * Set filterTeamHandle. + * + * @param filterTeamHandle Filter mappings by owning team handle. (optional) + * @return ListTeamsOwnershipRulesOptionalParameters + */ + public ListTeamsOwnershipRulesOptionalParameters filterTeamHandle( + List filterTeamHandle) { + this.filterTeamHandle = filterTeamHandle; + return this; + } + + /** + * Set filterApplicationId. + * + * @param filterApplicationId Filter mappings by RUM application ID. Each value must be a valid + * UUID. (optional) + * @return ListTeamsOwnershipRulesOptionalParameters + */ + public ListTeamsOwnershipRulesOptionalParameters filterApplicationId( + List filterApplicationId) { + this.filterApplicationId = filterApplicationId; + return this; + } + + /** + * Set filterService. + * + * @param filterService Filter mappings by RUM application service name. (optional) + * @return ListTeamsOwnershipRulesOptionalParameters + */ + public ListTeamsOwnershipRulesOptionalParameters filterService(List filterService) { + this.filterService = filterService; + return this; + } + } + + /** + * List teams ownership rules. + * + *

See {@link #listTeamsOwnershipRulesWithHttpInfo}. + * + * @return TeamsOwnershipRulesResponse + * @throws ApiException if fails to make API call + */ + public TeamsOwnershipRulesResponse listTeamsOwnershipRules() throws ApiException { + return listTeamsOwnershipRulesWithHttpInfo(new ListTeamsOwnershipRulesOptionalParameters()) + .getData(); + } + + /** + * List teams ownership rules. + * + *

See {@link #listTeamsOwnershipRulesWithHttpInfoAsync}. + * + * @return CompletableFuture<TeamsOwnershipRulesResponse> + */ + public CompletableFuture listTeamsOwnershipRulesAsync() { + return listTeamsOwnershipRulesWithHttpInfoAsync(new ListTeamsOwnershipRulesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List teams ownership rules. + * + *

See {@link #listTeamsOwnershipRulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return TeamsOwnershipRulesResponse + * @throws ApiException if fails to make API call + */ + public TeamsOwnershipRulesResponse listTeamsOwnershipRules( + ListTeamsOwnershipRulesOptionalParameters parameters) throws ApiException { + return listTeamsOwnershipRulesWithHttpInfo(parameters).getData(); + } + + /** + * List teams ownership rules. + * + *

See {@link #listTeamsOwnershipRulesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<TeamsOwnershipRulesResponse> + */ + public CompletableFuture listTeamsOwnershipRulesAsync( + ListTeamsOwnershipRulesOptionalParameters parameters) { + return listTeamsOwnershipRulesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the list of teams ownership rules for your organization, optionally filtered. Rules group + * the underlying mappings by view_name, application_id, service + * , and match_type, collapsing every team that owns the same view into a + * single entry. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<TeamsOwnershipRulesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse listTeamsOwnershipRulesWithHttpInfo( + ListTeamsOwnershipRulesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listTeamsOwnershipRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + List filterViewName = parameters.filterViewName; + List filterTeamHandle = parameters.filterTeamHandle; + List filterApplicationId = parameters.filterApplicationId; + List filterService = parameters.filterService; + // create path and map variables + String localVarPath = "/api/v2/rum/config/teams-ownership/rules"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[view_name]", filterViewName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[team_handle]", filterTeamHandle)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[application_id]", filterApplicationId)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[service]", filterService)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.listTeamsOwnershipRules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List teams ownership rules. + * + *

See {@link #listTeamsOwnershipRulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<TeamsOwnershipRulesResponse>> + */ + public CompletableFuture> + listTeamsOwnershipRulesWithHttpInfoAsync( + ListTeamsOwnershipRulesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listTeamsOwnershipRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + List filterViewName = parameters.filterViewName; + List filterTeamHandle = parameters.filterTeamHandle; + List filterApplicationId = parameters.filterApplicationId; + List filterService = parameters.filterService; + // create path and map variables + String localVarPath = "/api/v2/rum/config/teams-ownership/rules"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[view_name]", filterViewName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[team_handle]", filterTeamHandle)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[application_id]", filterApplicationId)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[service]", filterService)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.RumTeamsOwnershipApi.listTeamsOwnershipRules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchError.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchError.java new file mode 100644 index 00000000000..014e3b3e5cf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchError.java @@ -0,0 +1,202 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** An error encountered while validating or applying an operation. */ +@JsonPropertyOrder({ + TeamsOwnershipMappingBatchError.JSON_PROPERTY_DETAIL, + TeamsOwnershipMappingBatchError.JSON_PROPERTY_STATUS, + TeamsOwnershipMappingBatchError.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingBatchError { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DETAIL = "detail"; + private String detail; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public TeamsOwnershipMappingBatchError() {} + + @JsonCreator + public TeamsOwnershipMappingBatchError( + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.status = status; + this.title = title; + } + + public TeamsOwnershipMappingBatchError detail(String detail) { + this.detail = detail; + return this; + } + + /** + * A human-readable explanation specific to this error. + * + * @return detail + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDetail() { + return detail; + } + + public void setDetail(String detail) { + this.detail = detail; + } + + public TeamsOwnershipMappingBatchError status(String status) { + this.status = status; + return this; + } + + /** + * The HTTP status code applicable to this error. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public TeamsOwnershipMappingBatchError title(String title) { + this.title = title; + return this; + } + + /** + * A short, human-readable summary of the error. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingBatchError + */ + @JsonAnySetter + public TeamsOwnershipMappingBatchError putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingBatchError object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingBatchError teamsOwnershipMappingBatchError = + (TeamsOwnershipMappingBatchError) o; + return Objects.equals(this.detail, teamsOwnershipMappingBatchError.detail) + && Objects.equals(this.status, teamsOwnershipMappingBatchError.status) + && Objects.equals(this.title, teamsOwnershipMappingBatchError.title) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingBatchError.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(detail, status, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingBatchError {\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperation.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperation.java new file mode 100644 index 00000000000..1203adb8dba --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperation.java @@ -0,0 +1,217 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * A single add or remove operation, applied atomically with every other operation in the request. + */ +@JsonPropertyOrder({ + TeamsOwnershipMappingBatchOperation.JSON_PROPERTY_DATA, + TeamsOwnershipMappingBatchOperation.JSON_PROPERTY_OP, + TeamsOwnershipMappingBatchOperation.JSON_PROPERTY_REF +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingBatchOperation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamsOwnershipMappingBatchOperationData data; + + public static final String JSON_PROPERTY_OP = "op"; + private TeamsOwnershipMappingBatchOperationOp op; + + public static final String JSON_PROPERTY_REF = "ref"; + private TeamsOwnershipMappingBatchOperationRef ref; + + public TeamsOwnershipMappingBatchOperation() {} + + @JsonCreator + public TeamsOwnershipMappingBatchOperation( + @JsonProperty(required = true, value = JSON_PROPERTY_OP) + TeamsOwnershipMappingBatchOperationOp op) { + this.op = op; + this.unparsed |= !op.isValid(); + } + + public TeamsOwnershipMappingBatchOperation data(TeamsOwnershipMappingBatchOperationData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The mapping to add. Required when op is add. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamsOwnershipMappingBatchOperationData getData() { + return data; + } + + public void setData(TeamsOwnershipMappingBatchOperationData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + public TeamsOwnershipMappingBatchOperation op(TeamsOwnershipMappingBatchOperationOp op) { + this.op = op; + this.unparsed |= !op.isValid(); + return this; + } + + /** + * Whether this operation adds a new mapping or removes an existing one. + * + * @return op + */ + @JsonProperty(JSON_PROPERTY_OP) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingBatchOperationOp getOp() { + return op; + } + + public void setOp(TeamsOwnershipMappingBatchOperationOp op) { + if (!op.isValid()) { + this.unparsed = true; + } + this.op = op; + } + + public TeamsOwnershipMappingBatchOperation ref(TeamsOwnershipMappingBatchOperationRef ref) { + this.ref = ref; + this.unparsed |= ref.unparsed; + return this; + } + + /** + * Identifies an existing mapping to remove. Required when op is remove. + * + * @return ref + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamsOwnershipMappingBatchOperationRef getRef() { + return ref; + } + + public void setRef(TeamsOwnershipMappingBatchOperationRef ref) { + this.ref = ref; + if (ref != null) { + this.unparsed |= ref.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingBatchOperation + */ + @JsonAnySetter + public TeamsOwnershipMappingBatchOperation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingBatchOperation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingBatchOperation teamsOwnershipMappingBatchOperation = + (TeamsOwnershipMappingBatchOperation) o; + return Objects.equals(this.data, teamsOwnershipMappingBatchOperation.data) + && Objects.equals(this.op, teamsOwnershipMappingBatchOperation.op) + && Objects.equals(this.ref, teamsOwnershipMappingBatchOperation.ref) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingBatchOperation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, op, ref, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingBatchOperation {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" ref: ").append(toIndentedString(ref)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationData.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationData.java new file mode 100644 index 00000000000..aa7cfd8c1f5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationData.java @@ -0,0 +1,189 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The mapping to add. Required when op is add. */ +@JsonPropertyOrder({ + TeamsOwnershipMappingBatchOperationData.JSON_PROPERTY_ATTRIBUTES, + TeamsOwnershipMappingBatchOperationData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingBatchOperationData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamsOwnershipMappingBatchOperationDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamsOwnershipMappingType type = TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS; + + public TeamsOwnershipMappingBatchOperationData() {} + + @JsonCreator + public TeamsOwnershipMappingBatchOperationData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TeamsOwnershipMappingBatchOperationDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamsOwnershipMappingType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamsOwnershipMappingBatchOperationData attributes( + TeamsOwnershipMappingBatchOperationDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of the mapping to add. team_handle and view_name are + * required when op is add. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingBatchOperationDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamsOwnershipMappingBatchOperationDataAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public TeamsOwnershipMappingBatchOperationData type(TeamsOwnershipMappingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. The value should always be teams_ownership_mappings. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingType getType() { + return type; + } + + public void setType(TeamsOwnershipMappingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingBatchOperationData + */ + @JsonAnySetter + public TeamsOwnershipMappingBatchOperationData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingBatchOperationData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingBatchOperationData teamsOwnershipMappingBatchOperationData = + (TeamsOwnershipMappingBatchOperationData) o; + return Objects.equals(this.attributes, teamsOwnershipMappingBatchOperationData.attributes) + && Objects.equals(this.type, teamsOwnershipMappingBatchOperationData.type) + && Objects.equals( + this.additionalProperties, + teamsOwnershipMappingBatchOperationData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingBatchOperationData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationDataAttributes.java new file mode 100644 index 00000000000..24f3e4115f1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationDataAttributes.java @@ -0,0 +1,268 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** + * The attributes of the mapping to add. team_handle and view_name are + * required when op is add. + */ +@JsonPropertyOrder({ + TeamsOwnershipMappingBatchOperationDataAttributes.JSON_PROPERTY_APPLICATION_ID, + TeamsOwnershipMappingBatchOperationDataAttributes.JSON_PROPERTY_MATCH_TYPE, + TeamsOwnershipMappingBatchOperationDataAttributes.JSON_PROPERTY_SERVICE, + TeamsOwnershipMappingBatchOperationDataAttributes.JSON_PROPERTY_TEAM_HANDLE, + TeamsOwnershipMappingBatchOperationDataAttributes.JSON_PROPERTY_VIEW_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingBatchOperationDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_APPLICATION_ID = "application_id"; + private UUID applicationId; + + public static final String JSON_PROPERTY_MATCH_TYPE = "match_type"; + private TeamsOwnershipMatchType matchType = TeamsOwnershipMatchType.EXACT; + + public static final String JSON_PROPERTY_SERVICE = "service"; + private String service; + + public static final String JSON_PROPERTY_TEAM_HANDLE = "team_handle"; + private String teamHandle; + + public static final String JSON_PROPERTY_VIEW_NAME = "view_name"; + private String viewName; + + public TeamsOwnershipMappingBatchOperationDataAttributes applicationId(UUID applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * The ID of the RUM application this mapping applies to. For browser applications, provide the + * real application UUID — the team is applied to the view regardless of service. For mobile + * applications, omit this field (or set it to the nil UUID + * 00000000-0000-0000-0000-000000000000) — the team is applied to the view and service + * combination across all applications. + * + * @return applicationId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_APPLICATION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getApplicationId() { + return applicationId; + } + + public void setApplicationId(UUID applicationId) { + this.applicationId = applicationId; + } + + public TeamsOwnershipMappingBatchOperationDataAttributes matchType( + TeamsOwnershipMatchType matchType) { + this.matchType = matchType; + this.unparsed |= !matchType.isValid(); + return this; + } + + /** + * How the view_name is matched against RUM view names. + * + * @return matchType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MATCH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamsOwnershipMatchType getMatchType() { + return matchType; + } + + public void setMatchType(TeamsOwnershipMatchType matchType) { + if (!matchType.isValid()) { + this.unparsed = true; + } + this.matchType = matchType; + } + + public TeamsOwnershipMappingBatchOperationDataAttributes service(String service) { + this.service = service; + return this; + } + + /** + * The RUM application's service name. For browser applications, this is optional. For mobile + * applications, this is required and scopes the ownership to a specific service. + * + * @return service + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getService() { + return service; + } + + public void setService(String service) { + this.service = service; + } + + public TeamsOwnershipMappingBatchOperationDataAttributes teamHandle(String teamHandle) { + this.teamHandle = teamHandle; + return this; + } + + /** + * The handle of the team that owns the matched RUM views. + * + * @return teamHandle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEAM_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTeamHandle() { + return teamHandle; + } + + public void setTeamHandle(String teamHandle) { + this.teamHandle = teamHandle; + } + + public TeamsOwnershipMappingBatchOperationDataAttributes viewName(String viewName) { + this.viewName = viewName; + return this; + } + + /** + * The RUM view name to match, or its prefix when match_type is prefix. + * + * @return viewName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VIEW_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getViewName() { + return viewName; + } + + public void setViewName(String viewName) { + this.viewName = viewName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingBatchOperationDataAttributes + */ + @JsonAnySetter + public TeamsOwnershipMappingBatchOperationDataAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingBatchOperationDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingBatchOperationDataAttributes + teamsOwnershipMappingBatchOperationDataAttributes = + (TeamsOwnershipMappingBatchOperationDataAttributes) o; + return Objects.equals( + this.applicationId, teamsOwnershipMappingBatchOperationDataAttributes.applicationId) + && Objects.equals( + this.matchType, teamsOwnershipMappingBatchOperationDataAttributes.matchType) + && Objects.equals(this.service, teamsOwnershipMappingBatchOperationDataAttributes.service) + && Objects.equals( + this.teamHandle, teamsOwnershipMappingBatchOperationDataAttributes.teamHandle) + && Objects.equals(this.viewName, teamsOwnershipMappingBatchOperationDataAttributes.viewName) + && Objects.equals( + this.additionalProperties, + teamsOwnershipMappingBatchOperationDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + applicationId, matchType, service, teamHandle, viewName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingBatchOperationDataAttributes {\n"); + sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n"); + sb.append(" matchType: ").append(toIndentedString(matchType)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" teamHandle: ").append(toIndentedString(teamHandle)).append("\n"); + sb.append(" viewName: ").append(toIndentedString(viewName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationOp.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationOp.java new file mode 100644 index 00000000000..7f07d2d4090 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationOp.java @@ -0,0 +1,64 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Whether this operation adds a new mapping or removes an existing one. */ +@JsonSerialize( + using = + TeamsOwnershipMappingBatchOperationOp.TeamsOwnershipMappingBatchOperationOpSerializer.class) +public class TeamsOwnershipMappingBatchOperationOp extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("add", "remove")); + + public static final TeamsOwnershipMappingBatchOperationOp ADD = + new TeamsOwnershipMappingBatchOperationOp("add"); + public static final TeamsOwnershipMappingBatchOperationOp REMOVE = + new TeamsOwnershipMappingBatchOperationOp("remove"); + + TeamsOwnershipMappingBatchOperationOp(String value) { + super(value, allowedValues); + } + + public static class TeamsOwnershipMappingBatchOperationOpSerializer + extends StdSerializer { + public TeamsOwnershipMappingBatchOperationOpSerializer( + Class t) { + super(t); + } + + public TeamsOwnershipMappingBatchOperationOpSerializer() { + this(null); + } + + @Override + public void serialize( + TeamsOwnershipMappingBatchOperationOp value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TeamsOwnershipMappingBatchOperationOp fromValue(String value) { + return new TeamsOwnershipMappingBatchOperationOp(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationRef.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationRef.java new file mode 100644 index 00000000000..d838db29ba7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchOperationRef.java @@ -0,0 +1,182 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Identifies an existing mapping to remove. Required when op is remove. + */ +@JsonPropertyOrder({ + TeamsOwnershipMappingBatchOperationRef.JSON_PROPERTY_ID, + TeamsOwnershipMappingBatchOperationRef.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingBatchOperationRef { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamsOwnershipMappingType type = TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS; + + public TeamsOwnershipMappingBatchOperationRef() {} + + @JsonCreator + public TeamsOwnershipMappingBatchOperationRef( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamsOwnershipMappingType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamsOwnershipMappingBatchOperationRef id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the mapping to remove. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamsOwnershipMappingBatchOperationRef type(TeamsOwnershipMappingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. The value should always be teams_ownership_mappings. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingType getType() { + return type; + } + + public void setType(TeamsOwnershipMappingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingBatchOperationRef + */ + @JsonAnySetter + public TeamsOwnershipMappingBatchOperationRef putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingBatchOperationRef object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingBatchOperationRef teamsOwnershipMappingBatchOperationRef = + (TeamsOwnershipMappingBatchOperationRef) o; + return Objects.equals(this.id, teamsOwnershipMappingBatchOperationRef.id) + && Objects.equals(this.type, teamsOwnershipMappingBatchOperationRef.type) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingBatchOperationRef.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingBatchOperationRef {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchRequest.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchRequest.java new file mode 100644 index 00000000000..90bffd52ff3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchRequest.java @@ -0,0 +1,167 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The request body for bulk-creating and bulk-removing teams ownership mappings. */ +@JsonPropertyOrder({TeamsOwnershipMappingBatchRequest.JSON_PROPERTY_ATOMIC_OPERATIONS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingBatchRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATOMIC_OPERATIONS = "atomic:operations"; + private List atomicOperations = new ArrayList<>(); + + public TeamsOwnershipMappingBatchRequest() {} + + @JsonCreator + public TeamsOwnershipMappingBatchRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_ATOMIC_OPERATIONS) + List atomicOperations) { + this.atomicOperations = atomicOperations; + for (TeamsOwnershipMappingBatchOperation item : atomicOperations) { + this.unparsed |= item.unparsed; + } + } + + public TeamsOwnershipMappingBatchRequest atomicOperations( + List atomicOperations) { + this.atomicOperations = atomicOperations; + for (TeamsOwnershipMappingBatchOperation item : atomicOperations) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamsOwnershipMappingBatchRequest addAtomicOperationsItem( + TeamsOwnershipMappingBatchOperation atomicOperationsItem) { + this.atomicOperations.add(atomicOperationsItem); + this.unparsed |= atomicOperationsItem.unparsed; + return this; + } + + /** + * The ordered list of add and remove operations to apply atomically. + * + * @return atomicOperations + */ + @JsonProperty(JSON_PROPERTY_ATOMIC_OPERATIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getAtomicOperations() { + return atomicOperations; + } + + public void setAtomicOperations(List atomicOperations) { + this.atomicOperations = atomicOperations; + if (atomicOperations != null) { + for (TeamsOwnershipMappingBatchOperation item : atomicOperations) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingBatchRequest + */ + @JsonAnySetter + public TeamsOwnershipMappingBatchRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingBatchRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingBatchRequest teamsOwnershipMappingBatchRequest = + (TeamsOwnershipMappingBatchRequest) o; + return Objects.equals(this.atomicOperations, teamsOwnershipMappingBatchRequest.atomicOperations) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingBatchRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(atomicOperations, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingBatchRequest {\n"); + sb.append(" atomicOperations: ").append(toIndentedString(atomicOperations)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResponse.java new file mode 100644 index 00000000000..551c7971149 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResponse.java @@ -0,0 +1,215 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * The response body for the bulk create and remove operation. On success, atomic:results + * contains one entry per operation, in request order. On failure, no operations were + * applied and errors describes what went wrong. + */ +@JsonPropertyOrder({ + TeamsOwnershipMappingBatchResponse.JSON_PROPERTY_ATOMIC_RESULTS, + TeamsOwnershipMappingBatchResponse.JSON_PROPERTY_ERRORS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingBatchResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATOMIC_RESULTS = "atomic:results"; + private List atomicResults = null; + + public static final String JSON_PROPERTY_ERRORS = "errors"; + private List errors = null; + + public TeamsOwnershipMappingBatchResponse atomicResults( + List atomicResults) { + this.atomicResults = atomicResults; + if (atomicResults != null) { + for (TeamsOwnershipMappingBatchResult item : atomicResults) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public TeamsOwnershipMappingBatchResponse addAtomicResultsItem( + TeamsOwnershipMappingBatchResult atomicResultsItem) { + if (this.atomicResults == null) { + this.atomicResults = new ArrayList<>(); + } + this.atomicResults.add(atomicResultsItem); + this.unparsed |= atomicResultsItem.unparsed; + return this; + } + + /** + * The result of each operation. Add operations are processed first, then remove operations, so + * results may not appear in the same order as the request. Present only on success. + * + * @return atomicResults + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATOMIC_RESULTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAtomicResults() { + return atomicResults; + } + + public void setAtomicResults(List atomicResults) { + this.atomicResults = atomicResults; + if (atomicResults != null) { + for (TeamsOwnershipMappingBatchResult item : atomicResults) { + this.unparsed |= item.unparsed; + } + } + } + + public TeamsOwnershipMappingBatchResponse errors(List errors) { + this.errors = errors; + if (errors != null) { + for (TeamsOwnershipMappingBatchError item : errors) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public TeamsOwnershipMappingBatchResponse addErrorsItem( + TeamsOwnershipMappingBatchError errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + this.unparsed |= errorsItem.unparsed; + return this; + } + + /** + * The validation or processing errors encountered. Present only when the request could not be + * completed. + * + * @return errors + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERRORS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getErrors() { + return errors; + } + + public void setErrors(List errors) { + this.errors = errors; + if (errors != null) { + for (TeamsOwnershipMappingBatchError item : errors) { + this.unparsed |= item.unparsed; + } + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingBatchResponse + */ + @JsonAnySetter + public TeamsOwnershipMappingBatchResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingBatchResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingBatchResponse teamsOwnershipMappingBatchResponse = + (TeamsOwnershipMappingBatchResponse) o; + return Objects.equals(this.atomicResults, teamsOwnershipMappingBatchResponse.atomicResults) + && Objects.equals(this.errors, teamsOwnershipMappingBatchResponse.errors) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingBatchResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(atomicResults, errors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingBatchResponse {\n"); + sb.append(" atomicResults: ").append(toIndentedString(atomicResults)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResult.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResult.java new file mode 100644 index 00000000000..f23606aa8d5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResult.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * The result of a single operation. Add operations are processed first, then remove operations, so + * results may not appear in the same order as the request. Empty for remove + * operations. + */ +@JsonPropertyOrder({TeamsOwnershipMappingBatchResult.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingBatchResult { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamsOwnershipMappingBatchResultData data; + + public TeamsOwnershipMappingBatchResult data(TeamsOwnershipMappingBatchResultData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The mapping created by an add operation. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamsOwnershipMappingBatchResultData getData() { + return data; + } + + public void setData(TeamsOwnershipMappingBatchResultData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingBatchResult + */ + @JsonAnySetter + public TeamsOwnershipMappingBatchResult putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingBatchResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingBatchResult teamsOwnershipMappingBatchResult = + (TeamsOwnershipMappingBatchResult) o; + return Objects.equals(this.data, teamsOwnershipMappingBatchResult.data) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingBatchResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingBatchResult {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResultData.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResultData.java new file mode 100644 index 00000000000..a2643f6c796 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingBatchResultData.java @@ -0,0 +1,215 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The mapping created by an add operation. */ +@JsonPropertyOrder({ + TeamsOwnershipMappingBatchResultData.JSON_PROPERTY_ATTRIBUTES, + TeamsOwnershipMappingBatchResultData.JSON_PROPERTY_ID, + TeamsOwnershipMappingBatchResultData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingBatchResultData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamsOwnershipMappingResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamsOwnershipMappingType type = TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS; + + public TeamsOwnershipMappingBatchResultData() {} + + @JsonCreator + public TeamsOwnershipMappingBatchResultData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TeamsOwnershipMappingResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamsOwnershipMappingType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamsOwnershipMappingBatchResultData attributes( + TeamsOwnershipMappingResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a teams ownership mapping. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamsOwnershipMappingResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public TeamsOwnershipMappingBatchResultData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the teams ownership mapping. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamsOwnershipMappingBatchResultData type(TeamsOwnershipMappingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. The value should always be teams_ownership_mappings. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingType getType() { + return type; + } + + public void setType(TeamsOwnershipMappingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingBatchResultData + */ + @JsonAnySetter + public TeamsOwnershipMappingBatchResultData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingBatchResultData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingBatchResultData teamsOwnershipMappingBatchResultData = + (TeamsOwnershipMappingBatchResultData) o; + return Objects.equals(this.attributes, teamsOwnershipMappingBatchResultData.attributes) + && Objects.equals(this.id, teamsOwnershipMappingBatchResultData.id) + && Objects.equals(this.type, teamsOwnershipMappingBatchResultData.type) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingBatchResultData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingBatchResultData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateData.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateData.java new file mode 100644 index 00000000000..6c34049ec91 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateData.java @@ -0,0 +1,187 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The JSON:API data envelope for a teams ownership mapping create request. */ +@JsonPropertyOrder({ + TeamsOwnershipMappingCreateData.JSON_PROPERTY_ATTRIBUTES, + TeamsOwnershipMappingCreateData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingCreateData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamsOwnershipMappingCreateDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamsOwnershipMappingType type = TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS; + + public TeamsOwnershipMappingCreateData() {} + + @JsonCreator + public TeamsOwnershipMappingCreateData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TeamsOwnershipMappingCreateDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamsOwnershipMappingType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamsOwnershipMappingCreateData attributes( + TeamsOwnershipMappingCreateDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of the teams ownership mapping to create. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingCreateDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamsOwnershipMappingCreateDataAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public TeamsOwnershipMappingCreateData type(TeamsOwnershipMappingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. The value should always be teams_ownership_mappings. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingType getType() { + return type; + } + + public void setType(TeamsOwnershipMappingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingCreateData + */ + @JsonAnySetter + public TeamsOwnershipMappingCreateData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingCreateData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingCreateData teamsOwnershipMappingCreateData = + (TeamsOwnershipMappingCreateData) o; + return Objects.equals(this.attributes, teamsOwnershipMappingCreateData.attributes) + && Objects.equals(this.type, teamsOwnershipMappingCreateData.type) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingCreateData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingCreateData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateDataAttributes.java new file mode 100644 index 00000000000..21b3f530705 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateDataAttributes.java @@ -0,0 +1,269 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** The attributes of the teams ownership mapping to create. */ +@JsonPropertyOrder({ + TeamsOwnershipMappingCreateDataAttributes.JSON_PROPERTY_APPLICATION_ID, + TeamsOwnershipMappingCreateDataAttributes.JSON_PROPERTY_MATCH_TYPE, + TeamsOwnershipMappingCreateDataAttributes.JSON_PROPERTY_SERVICE, + TeamsOwnershipMappingCreateDataAttributes.JSON_PROPERTY_TEAM_HANDLE, + TeamsOwnershipMappingCreateDataAttributes.JSON_PROPERTY_VIEW_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingCreateDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_APPLICATION_ID = "application_id"; + private UUID applicationId; + + public static final String JSON_PROPERTY_MATCH_TYPE = "match_type"; + private TeamsOwnershipMatchType matchType = TeamsOwnershipMatchType.EXACT; + + public static final String JSON_PROPERTY_SERVICE = "service"; + private String service; + + public static final String JSON_PROPERTY_TEAM_HANDLE = "team_handle"; + private String teamHandle; + + public static final String JSON_PROPERTY_VIEW_NAME = "view_name"; + private String viewName; + + public TeamsOwnershipMappingCreateDataAttributes() {} + + @JsonCreator + public TeamsOwnershipMappingCreateDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TEAM_HANDLE) String teamHandle, + @JsonProperty(required = true, value = JSON_PROPERTY_VIEW_NAME) String viewName) { + this.teamHandle = teamHandle; + this.viewName = viewName; + } + + public TeamsOwnershipMappingCreateDataAttributes applicationId(UUID applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * The ID of the RUM application this mapping applies to. For browser applications, provide the + * real application UUID — the team is applied to the view regardless of service. For mobile + * applications, omit this field (or set it to the nil UUID + * 00000000-0000-0000-0000-000000000000) — the team is applied to the view and service + * combination across all applications. + * + * @return applicationId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_APPLICATION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getApplicationId() { + return applicationId; + } + + public void setApplicationId(UUID applicationId) { + this.applicationId = applicationId; + } + + public TeamsOwnershipMappingCreateDataAttributes matchType(TeamsOwnershipMatchType matchType) { + this.matchType = matchType; + this.unparsed |= !matchType.isValid(); + return this; + } + + /** + * How the view_name is matched against RUM view names. + * + * @return matchType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MATCH_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TeamsOwnershipMatchType getMatchType() { + return matchType; + } + + public void setMatchType(TeamsOwnershipMatchType matchType) { + if (!matchType.isValid()) { + this.unparsed = true; + } + this.matchType = matchType; + } + + public TeamsOwnershipMappingCreateDataAttributes service(String service) { + this.service = service; + return this; + } + + /** + * The RUM application's service name. For browser applications, this is optional. For mobile + * applications, this is required and scopes the ownership to a specific service. + * + * @return service + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getService() { + return service; + } + + public void setService(String service) { + this.service = service; + } + + public TeamsOwnershipMappingCreateDataAttributes teamHandle(String teamHandle) { + this.teamHandle = teamHandle; + return this; + } + + /** + * The handle of the team that owns the matched RUM views. + * + * @return teamHandle + */ + @JsonProperty(JSON_PROPERTY_TEAM_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTeamHandle() { + return teamHandle; + } + + public void setTeamHandle(String teamHandle) { + this.teamHandle = teamHandle; + } + + public TeamsOwnershipMappingCreateDataAttributes viewName(String viewName) { + this.viewName = viewName; + return this; + } + + /** + * The RUM view name to match, or its prefix when match_type is prefix. + * + * @return viewName + */ + @JsonProperty(JSON_PROPERTY_VIEW_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getViewName() { + return viewName; + } + + public void setViewName(String viewName) { + this.viewName = viewName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingCreateDataAttributes + */ + @JsonAnySetter + public TeamsOwnershipMappingCreateDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingCreateDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingCreateDataAttributes teamsOwnershipMappingCreateDataAttributes = + (TeamsOwnershipMappingCreateDataAttributes) o; + return Objects.equals( + this.applicationId, teamsOwnershipMappingCreateDataAttributes.applicationId) + && Objects.equals(this.matchType, teamsOwnershipMappingCreateDataAttributes.matchType) + && Objects.equals(this.service, teamsOwnershipMappingCreateDataAttributes.service) + && Objects.equals(this.teamHandle, teamsOwnershipMappingCreateDataAttributes.teamHandle) + && Objects.equals(this.viewName, teamsOwnershipMappingCreateDataAttributes.viewName) + && Objects.equals( + this.additionalProperties, + teamsOwnershipMappingCreateDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + applicationId, matchType, service, teamHandle, viewName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingCreateDataAttributes {\n"); + sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n"); + sb.append(" matchType: ").append(toIndentedString(matchType)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" teamHandle: ").append(toIndentedString(teamHandle)).append("\n"); + sb.append(" viewName: ").append(toIndentedString(viewName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateRequest.java new file mode 100644 index 00000000000..0b1dc67fb8c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingCreateRequest.java @@ -0,0 +1,151 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The request body for creating a teams ownership mapping. */ +@JsonPropertyOrder({TeamsOwnershipMappingCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamsOwnershipMappingCreateData data; + + public TeamsOwnershipMappingCreateRequest() {} + + @JsonCreator + public TeamsOwnershipMappingCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TeamsOwnershipMappingCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TeamsOwnershipMappingCreateRequest data(TeamsOwnershipMappingCreateData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The JSON:API data envelope for a teams ownership mapping create request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingCreateData getData() { + return data; + } + + public void setData(TeamsOwnershipMappingCreateData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingCreateRequest + */ + @JsonAnySetter + public TeamsOwnershipMappingCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingCreateRequest teamsOwnershipMappingCreateRequest = + (TeamsOwnershipMappingCreateRequest) o; + return Objects.equals(this.data, teamsOwnershipMappingCreateRequest.data) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponse.java new file mode 100644 index 00000000000..6af622080f7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponse.java @@ -0,0 +1,150 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The response body for a single teams ownership mapping. */ +@JsonPropertyOrder({TeamsOwnershipMappingResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TeamsOwnershipMappingResponseData data; + + public TeamsOwnershipMappingResponse() {} + + @JsonCreator + public TeamsOwnershipMappingResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TeamsOwnershipMappingResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TeamsOwnershipMappingResponse data(TeamsOwnershipMappingResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The JSON:API data envelope for a teams ownership mapping. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingResponseData getData() { + return data; + } + + public void setData(TeamsOwnershipMappingResponseData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingResponse + */ + @JsonAnySetter + public TeamsOwnershipMappingResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingResponse teamsOwnershipMappingResponse = (TeamsOwnershipMappingResponse) o; + return Objects.equals(this.data, teamsOwnershipMappingResponse.data) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponseAttributes.java new file mode 100644 index 00000000000..9e8e80e2953 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponseAttributes.java @@ -0,0 +1,364 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The attributes of a teams ownership mapping. */ +@JsonPropertyOrder({ + TeamsOwnershipMappingResponseAttributes.JSON_PROPERTY_APPLICATION_ID, + TeamsOwnershipMappingResponseAttributes.JSON_PROPERTY_CREATED_AT, + TeamsOwnershipMappingResponseAttributes.JSON_PROPERTY_CREATED_BY, + TeamsOwnershipMappingResponseAttributes.JSON_PROPERTY_MATCH_TYPE, + TeamsOwnershipMappingResponseAttributes.JSON_PROPERTY_ORG_ID, + TeamsOwnershipMappingResponseAttributes.JSON_PROPERTY_SERVICE, + TeamsOwnershipMappingResponseAttributes.JSON_PROPERTY_TEAM_HANDLE, + TeamsOwnershipMappingResponseAttributes.JSON_PROPERTY_VIEW_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_APPLICATION_ID = "application_id"; + private String applicationId; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private String createdBy; + + public static final String JSON_PROPERTY_MATCH_TYPE = "match_type"; + private TeamsOwnershipMatchType matchType = TeamsOwnershipMatchType.EXACT; + + public static final String JSON_PROPERTY_ORG_ID = "org_id"; + private Long orgId; + + public static final String JSON_PROPERTY_SERVICE = "service"; + private String service; + + public static final String JSON_PROPERTY_TEAM_HANDLE = "team_handle"; + private String teamHandle; + + public static final String JSON_PROPERTY_VIEW_NAME = "view_name"; + private String viewName; + + public TeamsOwnershipMappingResponseAttributes() {} + + @JsonCreator + public TeamsOwnershipMappingResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_APPLICATION_ID) String applicationId, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) String createdBy, + @JsonProperty(required = true, value = JSON_PROPERTY_MATCH_TYPE) + TeamsOwnershipMatchType matchType, + @JsonProperty(required = true, value = JSON_PROPERTY_ORG_ID) Long orgId, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE) String service, + @JsonProperty(required = true, value = JSON_PROPERTY_TEAM_HANDLE) String teamHandle, + @JsonProperty(required = true, value = JSON_PROPERTY_VIEW_NAME) String viewName) { + this.applicationId = applicationId; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.matchType = matchType; + this.unparsed |= !matchType.isValid(); + this.orgId = orgId; + this.service = service; + this.teamHandle = teamHandle; + this.viewName = viewName; + } + + public TeamsOwnershipMappingResponseAttributes applicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * The ID of the RUM application this mapping applies to. For browser applications, this is the + * real application UUID. For mobile applications, this is the nil UUID + * 00000000-0000-0000-0000-000000000000 (wildcard), meaning the ownership applies across + * all applications. + * + * @return applicationId + */ + @JsonProperty(JSON_PROPERTY_APPLICATION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getApplicationId() { + return applicationId; + } + + public void setApplicationId(String applicationId) { + this.applicationId = applicationId; + } + + public TeamsOwnershipMappingResponseAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp when the mapping was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public TeamsOwnershipMappingResponseAttributes createdBy(String createdBy) { + this.createdBy = createdBy; + return this; + } + + /** + * The UUID of the user who created the mapping. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public TeamsOwnershipMappingResponseAttributes matchType(TeamsOwnershipMatchType matchType) { + this.matchType = matchType; + this.unparsed |= !matchType.isValid(); + return this; + } + + /** + * How the view_name is matched against RUM view names. + * + * @return matchType + */ + @JsonProperty(JSON_PROPERTY_MATCH_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMatchType getMatchType() { + return matchType; + } + + public void setMatchType(TeamsOwnershipMatchType matchType) { + if (!matchType.isValid()) { + this.unparsed = true; + } + this.matchType = matchType; + } + + public TeamsOwnershipMappingResponseAttributes orgId(Long orgId) { + this.orgId = orgId; + return this; + } + + /** + * The ID of the organization that owns this mapping. + * + * @return orgId + */ + @JsonProperty(JSON_PROPERTY_ORG_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getOrgId() { + return orgId; + } + + public void setOrgId(Long orgId) { + this.orgId = orgId; + } + + public TeamsOwnershipMappingResponseAttributes service(String service) { + this.service = service; + return this; + } + + /** + * The RUM application's service name. For browser applications, may be empty. For mobile + * applications, this is the service that scopes the ownership. + * + * @return service + */ + @JsonProperty(JSON_PROPERTY_SERVICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getService() { + return service; + } + + public void setService(String service) { + this.service = service; + } + + public TeamsOwnershipMappingResponseAttributes teamHandle(String teamHandle) { + this.teamHandle = teamHandle; + return this; + } + + /** + * The handle of the team that owns the matched RUM views. + * + * @return teamHandle + */ + @JsonProperty(JSON_PROPERTY_TEAM_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTeamHandle() { + return teamHandle; + } + + public void setTeamHandle(String teamHandle) { + this.teamHandle = teamHandle; + } + + public TeamsOwnershipMappingResponseAttributes viewName(String viewName) { + this.viewName = viewName; + return this; + } + + /** + * The RUM view name to match, or its prefix when match_type is prefix. + * + * @return viewName + */ + @JsonProperty(JSON_PROPERTY_VIEW_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getViewName() { + return viewName; + } + + public void setViewName(String viewName) { + this.viewName = viewName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingResponseAttributes + */ + @JsonAnySetter + public TeamsOwnershipMappingResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingResponseAttributes teamsOwnershipMappingResponseAttributes = + (TeamsOwnershipMappingResponseAttributes) o; + return Objects.equals(this.applicationId, teamsOwnershipMappingResponseAttributes.applicationId) + && Objects.equals(this.createdAt, teamsOwnershipMappingResponseAttributes.createdAt) + && Objects.equals(this.createdBy, teamsOwnershipMappingResponseAttributes.createdBy) + && Objects.equals(this.matchType, teamsOwnershipMappingResponseAttributes.matchType) + && Objects.equals(this.orgId, teamsOwnershipMappingResponseAttributes.orgId) + && Objects.equals(this.service, teamsOwnershipMappingResponseAttributes.service) + && Objects.equals(this.teamHandle, teamsOwnershipMappingResponseAttributes.teamHandle) + && Objects.equals(this.viewName, teamsOwnershipMappingResponseAttributes.viewName) + && Objects.equals( + this.additionalProperties, + teamsOwnershipMappingResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + applicationId, + createdAt, + createdBy, + matchType, + orgId, + service, + teamHandle, + viewName, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingResponseAttributes {\n"); + sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" matchType: ").append(toIndentedString(matchType)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" teamHandle: ").append(toIndentedString(teamHandle)).append("\n"); + sb.append(" viewName: ").append(toIndentedString(viewName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponseData.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponseData.java new file mode 100644 index 00000000000..9ebfbdf527e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingResponseData.java @@ -0,0 +1,215 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The JSON:API data envelope for a teams ownership mapping. */ +@JsonPropertyOrder({ + TeamsOwnershipMappingResponseData.JSON_PROPERTY_ATTRIBUTES, + TeamsOwnershipMappingResponseData.JSON_PROPERTY_ID, + TeamsOwnershipMappingResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamsOwnershipMappingResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamsOwnershipMappingType type = TeamsOwnershipMappingType.TEAMS_OWNERSHIP_MAPPINGS; + + public TeamsOwnershipMappingResponseData() {} + + @JsonCreator + public TeamsOwnershipMappingResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TeamsOwnershipMappingResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamsOwnershipMappingType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamsOwnershipMappingResponseData attributes( + TeamsOwnershipMappingResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a teams ownership mapping. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamsOwnershipMappingResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public TeamsOwnershipMappingResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the teams ownership mapping. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamsOwnershipMappingResponseData type(TeamsOwnershipMappingType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. The value should always be teams_ownership_mappings. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMappingType getType() { + return type; + } + + public void setType(TeamsOwnershipMappingType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingResponseData + */ + @JsonAnySetter + public TeamsOwnershipMappingResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingResponseData teamsOwnershipMappingResponseData = + (TeamsOwnershipMappingResponseData) o; + return Objects.equals(this.attributes, teamsOwnershipMappingResponseData.attributes) + && Objects.equals(this.id, teamsOwnershipMappingResponseData.id) + && Objects.equals(this.type, teamsOwnershipMappingResponseData.type) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingType.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingType.java new file mode 100644 index 00000000000..593bbe519f7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of the resource. The value should always be teams_ownership_mappings. */ +@JsonSerialize(using = TeamsOwnershipMappingType.TeamsOwnershipMappingTypeSerializer.class) +public class TeamsOwnershipMappingType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("teams_ownership_mappings")); + + public static final TeamsOwnershipMappingType TEAMS_OWNERSHIP_MAPPINGS = + new TeamsOwnershipMappingType("teams_ownership_mappings"); + + TeamsOwnershipMappingType(String value) { + super(value, allowedValues); + } + + public static class TeamsOwnershipMappingTypeSerializer + extends StdSerializer { + public TeamsOwnershipMappingTypeSerializer(Class t) { + super(t); + } + + public TeamsOwnershipMappingTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TeamsOwnershipMappingType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TeamsOwnershipMappingType fromValue(String value) { + return new TeamsOwnershipMappingType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingsResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingsResponse.java new file mode 100644 index 00000000000..a991656e111 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMappingsResponse.java @@ -0,0 +1,198 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The response body for a list of teams ownership mappings. */ +@JsonPropertyOrder({ + TeamsOwnershipMappingsResponse.JSON_PROPERTY_DATA, + TeamsOwnershipMappingsResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipMappingsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private ResponseMetaAttributes meta; + + public TeamsOwnershipMappingsResponse() {} + + @JsonCreator + public TeamsOwnershipMappingsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + for (TeamsOwnershipMappingResponseData item : data) { + this.unparsed |= item.unparsed; + } + } + + public TeamsOwnershipMappingsResponse data(List data) { + this.data = data; + for (TeamsOwnershipMappingResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamsOwnershipMappingsResponse addDataItem(TeamsOwnershipMappingResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of teams ownership mappings. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (TeamsOwnershipMappingResponseData item : data) { + this.unparsed |= item.unparsed; + } + } + } + + public TeamsOwnershipMappingsResponse meta(ResponseMetaAttributes meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Object describing meta attributes of response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResponseMetaAttributes getMeta() { + return meta; + } + + public void setMeta(ResponseMetaAttributes meta) { + this.meta = meta; + if (meta != null) { + this.unparsed |= meta.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipMappingsResponse + */ + @JsonAnySetter + public TeamsOwnershipMappingsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipMappingsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipMappingsResponse teamsOwnershipMappingsResponse = + (TeamsOwnershipMappingsResponse) o; + return Objects.equals(this.data, teamsOwnershipMappingsResponse.data) + && Objects.equals(this.meta, teamsOwnershipMappingsResponse.meta) + && Objects.equals( + this.additionalProperties, teamsOwnershipMappingsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipMappingsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMatchType.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMatchType.java new file mode 100644 index 00000000000..0166af7ddec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipMatchType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** How the view_name is matched against RUM view names. */ +@JsonSerialize(using = TeamsOwnershipMatchType.TeamsOwnershipMatchTypeSerializer.class) +public class TeamsOwnershipMatchType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("exact", "prefix")); + + public static final TeamsOwnershipMatchType EXACT = new TeamsOwnershipMatchType("exact"); + public static final TeamsOwnershipMatchType PREFIX = new TeamsOwnershipMatchType("prefix"); + + TeamsOwnershipMatchType(String value) { + super(value, allowedValues); + } + + public static class TeamsOwnershipMatchTypeSerializer + extends StdSerializer { + public TeamsOwnershipMatchTypeSerializer(Class t) { + super(t); + } + + public TeamsOwnershipMatchTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TeamsOwnershipMatchType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TeamsOwnershipMatchType fromValue(String value) { + return new TeamsOwnershipMatchType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleResponseAttributes.java new file mode 100644 index 00000000000..c1ba3662307 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleResponseAttributes.java @@ -0,0 +1,290 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The attributes of a teams ownership rule. */ +@JsonPropertyOrder({ + TeamsOwnershipRuleResponseAttributes.JSON_PROPERTY_APPLICATION_ID, + TeamsOwnershipRuleResponseAttributes.JSON_PROPERTY_MATCH_TYPE, + TeamsOwnershipRuleResponseAttributes.JSON_PROPERTY_SERVICE, + TeamsOwnershipRuleResponseAttributes.JSON_PROPERTY_TEAMS, + TeamsOwnershipRuleResponseAttributes.JSON_PROPERTY_VIEW_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipRuleResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_APPLICATION_ID = "application_id"; + private String applicationId; + + public static final String JSON_PROPERTY_MATCH_TYPE = "match_type"; + private TeamsOwnershipMatchType matchType = TeamsOwnershipMatchType.EXACT; + + public static final String JSON_PROPERTY_SERVICE = "service"; + private String service; + + public static final String JSON_PROPERTY_TEAMS = "teams"; + private List teams = new ArrayList<>(); + + public static final String JSON_PROPERTY_VIEW_NAME = "view_name"; + private String viewName; + + public TeamsOwnershipRuleResponseAttributes() {} + + @JsonCreator + public TeamsOwnershipRuleResponseAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_APPLICATION_ID) String applicationId, + @JsonProperty(required = true, value = JSON_PROPERTY_MATCH_TYPE) + TeamsOwnershipMatchType matchType, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE) String service, + @JsonProperty(required = true, value = JSON_PROPERTY_TEAMS) + List teams, + @JsonProperty(required = true, value = JSON_PROPERTY_VIEW_NAME) String viewName) { + this.applicationId = applicationId; + this.matchType = matchType; + this.unparsed |= !matchType.isValid(); + this.service = service; + this.teams = teams; + for (TeamsOwnershipRuleTeamMapping item : teams) { + this.unparsed |= item.unparsed; + } + this.viewName = viewName; + } + + public TeamsOwnershipRuleResponseAttributes applicationId(String applicationId) { + this.applicationId = applicationId; + return this; + } + + /** + * The ID of the RUM application this mapping applies to. For browser applications, this is the + * real application UUID. For mobile applications, this is the nil UUID + * 00000000-0000-0000-0000-000000000000 (wildcard), meaning the ownership applies across + * all applications. + * + * @return applicationId + */ + @JsonProperty(JSON_PROPERTY_APPLICATION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getApplicationId() { + return applicationId; + } + + public void setApplicationId(String applicationId) { + this.applicationId = applicationId; + } + + public TeamsOwnershipRuleResponseAttributes matchType(TeamsOwnershipMatchType matchType) { + this.matchType = matchType; + this.unparsed |= !matchType.isValid(); + return this; + } + + /** + * How the view_name is matched against RUM view names. + * + * @return matchType + */ + @JsonProperty(JSON_PROPERTY_MATCH_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipMatchType getMatchType() { + return matchType; + } + + public void setMatchType(TeamsOwnershipMatchType matchType) { + if (!matchType.isValid()) { + this.unparsed = true; + } + this.matchType = matchType; + } + + public TeamsOwnershipRuleResponseAttributes service(String service) { + this.service = service; + return this; + } + + /** + * The RUM application's service name. For browser applications, may be empty. For mobile + * applications, this is the service that scopes the ownership. + * + * @return service + */ + @JsonProperty(JSON_PROPERTY_SERVICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getService() { + return service; + } + + public void setService(String service) { + this.service = service; + } + + public TeamsOwnershipRuleResponseAttributes teams(List teams) { + this.teams = teams; + for (TeamsOwnershipRuleTeamMapping item : teams) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamsOwnershipRuleResponseAttributes addTeamsItem( + TeamsOwnershipRuleTeamMapping teamsItem) { + this.teams.add(teamsItem); + this.unparsed |= teamsItem.unparsed; + return this; + } + + /** + * The teams that own the matched views, each paired with the ID of its underlying mapping. + * + * @return teams + */ + @JsonProperty(JSON_PROPERTY_TEAMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTeams() { + return teams; + } + + public void setTeams(List teams) { + this.teams = teams; + if (teams != null) { + for (TeamsOwnershipRuleTeamMapping item : teams) { + this.unparsed |= item.unparsed; + } + } + } + + public TeamsOwnershipRuleResponseAttributes viewName(String viewName) { + this.viewName = viewName; + return this; + } + + /** + * The RUM view name to match, or its prefix when match_type is prefix. + * + * @return viewName + */ + @JsonProperty(JSON_PROPERTY_VIEW_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getViewName() { + return viewName; + } + + public void setViewName(String viewName) { + this.viewName = viewName; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipRuleResponseAttributes + */ + @JsonAnySetter + public TeamsOwnershipRuleResponseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipRuleResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipRuleResponseAttributes teamsOwnershipRuleResponseAttributes = + (TeamsOwnershipRuleResponseAttributes) o; + return Objects.equals(this.applicationId, teamsOwnershipRuleResponseAttributes.applicationId) + && Objects.equals(this.matchType, teamsOwnershipRuleResponseAttributes.matchType) + && Objects.equals(this.service, teamsOwnershipRuleResponseAttributes.service) + && Objects.equals(this.teams, teamsOwnershipRuleResponseAttributes.teams) + && Objects.equals(this.viewName, teamsOwnershipRuleResponseAttributes.viewName) + && Objects.equals( + this.additionalProperties, teamsOwnershipRuleResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(applicationId, matchType, service, teams, viewName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipRuleResponseAttributes {\n"); + sb.append(" applicationId: ").append(toIndentedString(applicationId)).append("\n"); + sb.append(" matchType: ").append(toIndentedString(matchType)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" teams: ").append(toIndentedString(teams)).append("\n"); + sb.append(" viewName: ").append(toIndentedString(viewName)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleResponseData.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleResponseData.java new file mode 100644 index 00000000000..dda4db990f5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleResponseData.java @@ -0,0 +1,217 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The JSON:API data envelope for a teams ownership rule. */ +@JsonPropertyOrder({ + TeamsOwnershipRuleResponseData.JSON_PROPERTY_ATTRIBUTES, + TeamsOwnershipRuleResponseData.JSON_PROPERTY_ID, + TeamsOwnershipRuleResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipRuleResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TeamsOwnershipRuleResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TeamsOwnershipRuleType type = TeamsOwnershipRuleType.TEAMS_OWNERSHIP_GROUPED_MAPPINGS; + + public TeamsOwnershipRuleResponseData() {} + + @JsonCreator + public TeamsOwnershipRuleResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TeamsOwnershipRuleResponseAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TeamsOwnershipRuleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TeamsOwnershipRuleResponseData attributes( + TeamsOwnershipRuleResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * The attributes of a teams ownership rule. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipRuleResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TeamsOwnershipRuleResponseAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public TeamsOwnershipRuleResponseData id(String id) { + this.id = id; + return this; + } + + /** + * A deterministic identifier derived from the rule's grouping key. This ID cannot be used to + * delete the rule directly; delete individual mappings using the mapping_id under + * teams instead. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TeamsOwnershipRuleResponseData type(TeamsOwnershipRuleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. The value should always be teams_ownership_grouped_mappings. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TeamsOwnershipRuleType getType() { + return type; + } + + public void setType(TeamsOwnershipRuleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipRuleResponseData + */ + @JsonAnySetter + public TeamsOwnershipRuleResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipRuleResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipRuleResponseData teamsOwnershipRuleResponseData = + (TeamsOwnershipRuleResponseData) o; + return Objects.equals(this.attributes, teamsOwnershipRuleResponseData.attributes) + && Objects.equals(this.id, teamsOwnershipRuleResponseData.id) + && Objects.equals(this.type, teamsOwnershipRuleResponseData.type) + && Objects.equals( + this.additionalProperties, teamsOwnershipRuleResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipRuleResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleTeamMapping.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleTeamMapping.java new file mode 100644 index 00000000000..32b9b02354f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleTeamMapping.java @@ -0,0 +1,174 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** An individual team's ownership entry within a teams ownership rule. */ +@JsonPropertyOrder({ + TeamsOwnershipRuleTeamMapping.JSON_PROPERTY_MAPPING_ID, + TeamsOwnershipRuleTeamMapping.JSON_PROPERTY_TEAM_HANDLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipRuleTeamMapping { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MAPPING_ID = "mapping_id"; + private String mappingId; + + public static final String JSON_PROPERTY_TEAM_HANDLE = "team_handle"; + private String teamHandle; + + public TeamsOwnershipRuleTeamMapping() {} + + @JsonCreator + public TeamsOwnershipRuleTeamMapping( + @JsonProperty(required = true, value = JSON_PROPERTY_MAPPING_ID) String mappingId, + @JsonProperty(required = true, value = JSON_PROPERTY_TEAM_HANDLE) String teamHandle) { + this.mappingId = mappingId; + this.teamHandle = teamHandle; + } + + public TeamsOwnershipRuleTeamMapping mappingId(String mappingId) { + this.mappingId = mappingId; + return this; + } + + /** + * The ID of the underlying mapping, used to delete this team's ownership individually. + * + * @return mappingId + */ + @JsonProperty(JSON_PROPERTY_MAPPING_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMappingId() { + return mappingId; + } + + public void setMappingId(String mappingId) { + this.mappingId = mappingId; + } + + public TeamsOwnershipRuleTeamMapping teamHandle(String teamHandle) { + this.teamHandle = teamHandle; + return this; + } + + /** + * The handle of the owning team. + * + * @return teamHandle + */ + @JsonProperty(JSON_PROPERTY_TEAM_HANDLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTeamHandle() { + return teamHandle; + } + + public void setTeamHandle(String teamHandle) { + this.teamHandle = teamHandle; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipRuleTeamMapping + */ + @JsonAnySetter + public TeamsOwnershipRuleTeamMapping putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipRuleTeamMapping object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipRuleTeamMapping teamsOwnershipRuleTeamMapping = (TeamsOwnershipRuleTeamMapping) o; + return Objects.equals(this.mappingId, teamsOwnershipRuleTeamMapping.mappingId) + && Objects.equals(this.teamHandle, teamsOwnershipRuleTeamMapping.teamHandle) + && Objects.equals( + this.additionalProperties, teamsOwnershipRuleTeamMapping.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(mappingId, teamHandle, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipRuleTeamMapping {\n"); + sb.append(" mappingId: ").append(toIndentedString(mappingId)).append("\n"); + sb.append(" teamHandle: ").append(toIndentedString(teamHandle)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleType.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleType.java new file mode 100644 index 00000000000..48f08dab519 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRuleType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of the resource. The value should always be teams_ownership_grouped_mappings. */ +@JsonSerialize(using = TeamsOwnershipRuleType.TeamsOwnershipRuleTypeSerializer.class) +public class TeamsOwnershipRuleType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("teams_ownership_grouped_mappings")); + + public static final TeamsOwnershipRuleType TEAMS_OWNERSHIP_GROUPED_MAPPINGS = + new TeamsOwnershipRuleType("teams_ownership_grouped_mappings"); + + TeamsOwnershipRuleType(String value) { + super(value, allowedValues); + } + + public static class TeamsOwnershipRuleTypeSerializer + extends StdSerializer { + public TeamsOwnershipRuleTypeSerializer(Class t) { + super(t); + } + + public TeamsOwnershipRuleTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TeamsOwnershipRuleType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TeamsOwnershipRuleType fromValue(String value) { + return new TeamsOwnershipRuleType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRulesResponse.java b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRulesResponse.java new file mode 100644 index 00000000000..2768319366f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TeamsOwnershipRulesResponse.java @@ -0,0 +1,197 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The response body for a list of teams ownership rules. */ +@JsonPropertyOrder({ + TeamsOwnershipRulesResponse.JSON_PROPERTY_DATA, + TeamsOwnershipRulesResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TeamsOwnershipRulesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private ResponseMetaAttributes meta; + + public TeamsOwnershipRulesResponse() {} + + @JsonCreator + public TeamsOwnershipRulesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + for (TeamsOwnershipRuleResponseData item : data) { + this.unparsed |= item.unparsed; + } + } + + public TeamsOwnershipRulesResponse data(List data) { + this.data = data; + for (TeamsOwnershipRuleResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TeamsOwnershipRulesResponse addDataItem(TeamsOwnershipRuleResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of teams ownership rules. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (TeamsOwnershipRuleResponseData item : data) { + this.unparsed |= item.unparsed; + } + } + } + + public TeamsOwnershipRulesResponse meta(ResponseMetaAttributes meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Object describing meta attributes of response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ResponseMetaAttributes getMeta() { + return meta; + } + + public void setMeta(ResponseMetaAttributes meta) { + this.meta = meta; + if (meta != null) { + this.unparsed |= meta.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TeamsOwnershipRulesResponse + */ + @JsonAnySetter + public TeamsOwnershipRulesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TeamsOwnershipRulesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TeamsOwnershipRulesResponse teamsOwnershipRulesResponse = (TeamsOwnershipRulesResponse) o; + return Objects.equals(this.data, teamsOwnershipRulesResponse.data) + && Objects.equals(this.meta, teamsOwnershipRulesResponse.meta) + && Objects.equals( + this.additionalProperties, teamsOwnershipRulesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TeamsOwnershipRulesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/rum_teams_ownership.feature b/src/test/resources/com/datadog/api/client/v2/api/rum_teams_ownership.feature new file mode 100644 index 00000000000..5455d1af85e --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/rum_teams_ownership.feature @@ -0,0 +1,127 @@ +@endpoint(rum-teams-ownership) @endpoint(rum-teams-ownership-v2) +Feature: Rum Teams Ownership + Manage [teams ownership](https://docs.datadoghq.com/real_user_monitoring/p + latform/ownership/) mappings between RUM views and the teams that own + them. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "RumTeamsOwnership" API + + @team:DataDog/rum-backend + Scenario: Bulk create and remove teams ownership mappings returns "Bad Request" response + Given new "CreateTeamsOwnershipMappingsBatch" request + And body with value {"atomic:operations":[{"op":"add","data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout","service":"web-checkout","application_id":"invalid-uuid","match_type":"exact"}}}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Bulk create and remove teams ownership mappings returns "Bad Request. One or more operations failed validation, so none of the operations were applied." response + Given operation "CreateTeamsOwnershipMappingsBatch" enabled + And new "CreateTeamsOwnershipMappingsBatch" request + And body with value {"atomic:operations": [{"data": {"attributes": {"application_id": "11111111-2222-3333-4444-555555555555", "match_type": "exact", "service": "web-checkout", "team_handle": "team-rum", "view_name": "/checkout"}, "type": "teams_ownership_mappings"}, "op": "add", "ref": {"id": "456", "type": "teams_ownership_mappings"}}]} + When the request is sent + Then the response status is 400 Bad Request. One or more operations failed validation, so none of the operations were applied. + + @team:DataDog/rum-backend + Scenario: Bulk create and remove teams ownership mappings returns "OK" response + Given new "CreateTeamsOwnershipMappingsBatch" request + And body with value {"atomic:operations":[{"op":"add","data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout","service":"web-checkout","application_id":"11111111-2222-3333-4444-555555555555","match_type":"exact"}}},{"op":"remove","ref":{"type":"teams_ownership_mappings","id":"456"}}]} + When the request is sent + Then the response status is 200 OK + And the response "atomic:results[0].data.type" is equal to "teams_ownership_mappings" + And the response "atomic:results[0].data.attributes.team_handle" is equal to "team-rum" + And the response "atomic:results[0].data.attributes.match_type" is equal to "exact" + + @generated @skip @team:DataDog/rum-backend + Scenario: Create a teams ownership mapping returns "Bad Request" response + Given operation "CreateTeamsOwnershipMapping" enabled + And new "CreateTeamsOwnershipMapping" request + And body with value {"data": {"attributes": {"application_id": "11111111-2222-3333-4444-555555555555", "match_type": "exact", "service": "web-checkout", "team_handle": "team-rum", "view_name": "/checkout"}, "type": "teams_ownership_mappings"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/rum-backend + Scenario: Create a teams ownership mapping returns "Created" response + Given operation "CreateTeamsOwnershipMapping" enabled + And new "CreateTeamsOwnershipMapping" request + And body with value {"data": {"attributes": {"application_id": "11111111-2222-3333-4444-555555555555", "match_type": "exact", "service": "web-checkout", "team_handle": "team-rum", "view_name": "/checkout"}, "type": "teams_ownership_mappings"}} + When the request is sent + Then the response status is 201 Created + + @team:DataDog/rum-backend + Scenario: Create teams ownership mapping returns "Bad Request" response + Given new "CreateTeamsOwnershipMapping" request + And body with value {"data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout","service":"web-checkout","application_id":"invalid-uuid","match_type":"exact"}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/rum-backend + Scenario: Create teams ownership mapping returns "Created" response + Given new "CreateTeamsOwnershipMapping" request + And body with value {"data":{"type":"teams_ownership_mappings","attributes":{"team_handle":"team-rum","view_name":"/checkout","service":"web-checkout","application_id":"11111111-2222-3333-4444-555555555555","match_type":"exact"}}} + When the request is sent + Then the response status is 201 Created + And the response "data.type" is equal to "teams_ownership_mappings" + And the response "data.attributes.team_handle" is equal to "team-rum" + And the response "data.attributes.view_name" is equal to "/checkout" + And the response "data.attributes.service" is equal to "web-checkout" + And the response "data.attributes.application_id" is equal to "11111111-2222-3333-4444-555555555555" + And the response "data.attributes.match_type" is equal to "exact" + + @team:DataDog/rum-backend + Scenario: Delete a teams ownership mapping returns "No Content" response + Given new "DeleteTeamsOwnershipMapping" request + And request contains "id" parameter with value "123" + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/rum-backend + Scenario: Delete a teams ownership mapping returns "Not Found" response + Given new "DeleteTeamsOwnershipMapping" request + And request contains "id" parameter with value "{{ unique }}" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/rum-backend + Scenario: Get a teams ownership mapping returns "Not Found" response + Given new "GetTeamsOwnershipMapping" request + And request contains "id" parameter with value "{{ unique }}" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/rum-backend + Scenario: Get a teams ownership mapping returns "OK" response + Given new "GetTeamsOwnershipMapping" request + And request contains "id" parameter with value "123" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "123" + And the response "data.type" is equal to "teams_ownership_mappings" + And the response "data.attributes.team_handle" is equal to "team-rum" + And the response "data.attributes.view_name" is equal to "/checkout" + And the response "data.attributes.match_type" is equal to "exact" + + @team:DataDog/rum-backend + Scenario: List teams ownership mappings returns "OK" response + Given new "ListTeamsOwnershipMappings" request + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].type" is equal to "teams_ownership_mappings" + And the response "data[0].attributes.team_handle" is equal to "team-rum" + And the response "data[0].attributes.view_name" is equal to "/checkout" + And the response "data[0].attributes.service" is equal to "web-checkout" + And the response "data[0].attributes.application_id" is equal to "11111111-2222-3333-4444-555555555555" + And the response "data[0].attributes.match_type" is equal to "exact" + + @team:DataDog/rum-backend + Scenario: List teams ownership rules returns "OK" response + Given new "ListTeamsOwnershipRules" request + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + And the response "data[0].type" is equal to "teams_ownership_grouped_mappings" + And the response "data[0].attributes.view_name" is equal to "/checkout" + And the response "data[0].attributes.match_type" is equal to "exact" diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index df961ee10c8..118bc7179d6 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -7057,6 +7057,51 @@ "type": "idempotent" } }, + "ListTeamsOwnershipMappings": { + "tag": "Rum Teams Ownership", + "undo": { + "type": "safe" + } + }, + "CreateTeamsOwnershipMapping": { + "tag": "Rum Teams Ownership", + "undo": { + "operationId": "DeleteTeamsOwnershipMapping", + "parameters": [ + { + "name": "id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "CreateTeamsOwnershipMappingsBatch": { + "tag": "Rum Teams Ownership", + "undo": { + "operationId": "CreateTeamsOwnershipMappingsBatch", + "parameters": [], + "type": "unsafe" + } + }, + "DeleteTeamsOwnershipMapping": { + "tag": "Rum Teams Ownership", + "undo": { + "type": "idempotent" + } + }, + "GetTeamsOwnershipMapping": { + "tag": "Rum Teams Ownership", + "undo": { + "type": "safe" + } + }, + "ListTeamsOwnershipRules": { + "tag": "Rum Teams Ownership", + "undo": { + "type": "safe" + } + }, "ListRUMEvents": { "tag": "RUM", "undo": {