diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a5b1012c5d22..729e373ca026 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.ts b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping.ts new file mode 100644 index 000000000000..e8907668889c --- /dev/null +++ b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping.ts @@ -0,0 +1,33 @@ +/** + * Create a teams ownership mapping returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +configuration.unstableOperations["v2.createTeamsOwnershipMapping"] = true; +const apiInstance = new v2.RumTeamsOwnershipApi(configuration); + +const params: v2.RumTeamsOwnershipApiCreateTeamsOwnershipMappingRequest = { + body: { + data: { + attributes: { + applicationId: "11111111-2222-3333-4444-555555555555", + matchType: "exact", + service: "web-checkout", + teamHandle: "team-rum", + viewName: "/checkout", + }, + type: "teams_ownership_mappings", + }, + }, +}; + +apiInstance + .createTeamsOwnershipMapping(params) + .then((data: v2.TeamsOwnershipMappingResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping_1881412984.ts b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping_1881412984.ts new file mode 100644 index 000000000000..66a78c696095 --- /dev/null +++ b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMapping_1881412984.ts @@ -0,0 +1,32 @@ +/** + * Create teams ownership mapping returns "Created" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.RumTeamsOwnershipApi(configuration); + +const params: v2.RumTeamsOwnershipApiCreateTeamsOwnershipMappingRequest = { + body: { + data: { + type: "teams_ownership_mappings", + attributes: { + teamHandle: "team-rum", + viewName: "/checkout", + service: "web-checkout", + applicationId: "11111111-2222-3333-4444-555555555555", + matchType: "exact", + }, + }, + }, +}; + +apiInstance + .createTeamsOwnershipMapping(params) + .then((data: v2.TeamsOwnershipMappingResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMappingsBatch.ts b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMappingsBatch.ts new file mode 100644 index 000000000000..01c3a66ad389 --- /dev/null +++ b/examples/v2/rum-teams-ownership/CreateTeamsOwnershipMappingsBatch.ts @@ -0,0 +1,45 @@ +/** + * Bulk create and remove teams ownership mappings returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.RumTeamsOwnershipApi(configuration); + +const params: v2.RumTeamsOwnershipApiCreateTeamsOwnershipMappingsBatchRequest = + { + body: { + atomicOperations: [ + { + op: "add", + data: { + type: "teams_ownership_mappings", + attributes: { + teamHandle: "team-rum", + viewName: "/checkout", + service: "web-checkout", + applicationId: "11111111-2222-3333-4444-555555555555", + matchType: "exact", + }, + }, + }, + { + op: "remove", + ref: { + type: "teams_ownership_mappings", + id: "456", + }, + }, + ], + }, + }; + +apiInstance + .createTeamsOwnershipMappingsBatch(params) + .then((data: v2.TeamsOwnershipMappingBatchResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-teams-ownership/DeleteTeamsOwnershipMapping.ts b/examples/v2/rum-teams-ownership/DeleteTeamsOwnershipMapping.ts new file mode 100644 index 000000000000..c4b2248b7d9f --- /dev/null +++ b/examples/v2/rum-teams-ownership/DeleteTeamsOwnershipMapping.ts @@ -0,0 +1,21 @@ +/** + * Delete a teams ownership mapping returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.RumTeamsOwnershipApi(configuration); + +const params: v2.RumTeamsOwnershipApiDeleteTeamsOwnershipMappingRequest = { + id: "123", +}; + +apiInstance + .deleteTeamsOwnershipMapping(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-teams-ownership/GetTeamsOwnershipMapping.ts b/examples/v2/rum-teams-ownership/GetTeamsOwnershipMapping.ts new file mode 100644 index 000000000000..c96c09dd4e61 --- /dev/null +++ b/examples/v2/rum-teams-ownership/GetTeamsOwnershipMapping.ts @@ -0,0 +1,21 @@ +/** + * Get a teams ownership mapping returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.RumTeamsOwnershipApi(configuration); + +const params: v2.RumTeamsOwnershipApiGetTeamsOwnershipMappingRequest = { + id: "123", +}; + +apiInstance + .getTeamsOwnershipMapping(params) + .then((data: v2.TeamsOwnershipMappingResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-teams-ownership/ListTeamsOwnershipMappings.ts b/examples/v2/rum-teams-ownership/ListTeamsOwnershipMappings.ts new file mode 100644 index 000000000000..edb0c55bba95 --- /dev/null +++ b/examples/v2/rum-teams-ownership/ListTeamsOwnershipMappings.ts @@ -0,0 +1,17 @@ +/** + * List teams ownership mappings returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.RumTeamsOwnershipApi(configuration); + +apiInstance + .listTeamsOwnershipMappings() + .then((data: v2.TeamsOwnershipMappingsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/rum-teams-ownership/ListTeamsOwnershipRules.ts b/examples/v2/rum-teams-ownership/ListTeamsOwnershipRules.ts new file mode 100644 index 000000000000..0465b05ff0fd --- /dev/null +++ b/examples/v2/rum-teams-ownership/ListTeamsOwnershipRules.ts @@ -0,0 +1,17 @@ +/** + * List teams ownership rules returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.RumTeamsOwnershipApi(configuration); + +apiInstance + .listTeamsOwnershipRules() + .then((data: v2.TeamsOwnershipRulesResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 670f4390dd63..33b7a475a326 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -15323,6 +15323,72 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "RumMetricResponse", }, + "v2.ListTeamsOwnershipMappings": { + "filterViewName": { + "type": "Array", + "format": "", + }, + "filterTeamHandle": { + "type": "Array", + "format": "", + }, + "filterApplicationId": { + "type": "Array", + "format": "", + }, + "filterService": { + "type": "Array", + "format": "", + }, + "operationResponseType": "TeamsOwnershipMappingsResponse", + }, + "v2.CreateTeamsOwnershipMapping": { + "body": { + "type": "TeamsOwnershipMappingCreateRequest", + "format": "", + }, + "operationResponseType": "TeamsOwnershipMappingResponse", + }, + "v2.CreateTeamsOwnershipMappingsBatch": { + "body": { + "type": "TeamsOwnershipMappingBatchRequest", + "format": "", + }, + "operationResponseType": "TeamsOwnershipMappingBatchResponse", + }, + "v2.GetTeamsOwnershipMapping": { + "id": { + "type": "string", + "format": "", + }, + "operationResponseType": "TeamsOwnershipMappingResponse", + }, + "v2.DeleteTeamsOwnershipMapping": { + "id": { + "type": "string", + "format": "", + }, + "operationResponseType": "{}", + }, + "v2.ListTeamsOwnershipRules": { + "filterViewName": { + "type": "Array", + "format": "", + }, + "filterTeamHandle": { + "type": "Array", + "format": "", + }, + "filterApplicationId": { + "type": "Array", + "format": "", + }, + "filterService": { + "type": "Array", + "format": "", + }, + "operationResponseType": "TeamsOwnershipRulesResponse", + }, "v2.CreateRUMOperation": { "body": { "type": "RUMOperationCreateRequest", diff --git a/features/v2/rum_teams_ownership.feature b/features/v2/rum_teams_ownership.feature new file mode 100644 index 000000000000..5455d1af85e8 --- /dev/null +++ b/features/v2/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/features/v2/undo.json b/features/v2/undo.json index df961ee10c84..118bc7179d65 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/packages/datadog-api-client-common/configuration.ts b/packages/datadog-api-client-common/configuration.ts index bad8224bd94a..d063ed8cf9c0 100644 --- a/packages/datadog-api-client-common/configuration.ts +++ b/packages/datadog-api-client-common/configuration.ts @@ -706,6 +706,12 @@ export function createConfiguration( "v2.createRumConfig": false, "v2.getRumConfig": false, "v2.updateRumConfig": false, + "v2.createTeamsOwnershipMapping": false, + "v2.createTeamsOwnershipMappingsBatch": false, + "v2.deleteTeamsOwnershipMapping": false, + "v2.getTeamsOwnershipMapping": false, + "v2.listTeamsOwnershipMappings": false, + "v2.listTeamsOwnershipRules": false, "v2.createRUMOperation": false, "v2.createRUMOperationStrongLink": false, "v2.deleteRUMOperation": false, diff --git a/packages/datadog-api-client-v2/apis/RumTeamsOwnershipApi.ts b/packages/datadog-api-client-v2/apis/RumTeamsOwnershipApi.ts new file mode 100644 index 000000000000..da56b7b31ce8 --- /dev/null +++ b/packages/datadog-api-client-v2/apis/RumTeamsOwnershipApi.ts @@ -0,0 +1,972 @@ +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; +import { + Configuration, + applySecurityAuthentication, +} from "../../datadog-api-client-common/configuration"; +import { + RequestContext, + HttpMethod, + ResponseContext, +} from "../../datadog-api-client-common/http/http"; + +import { logger } from "../../../logger"; +import { ObjectSerializer } from "../models/ObjectSerializer"; +import { ApiException } from "../../datadog-api-client-common/exception"; + +import { APIErrorResponse } from "../models/APIErrorResponse"; +import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse"; +import { TeamsOwnershipMappingBatchRequest } from "../models/TeamsOwnershipMappingBatchRequest"; +import { TeamsOwnershipMappingBatchResponse } from "../models/TeamsOwnershipMappingBatchResponse"; +import { TeamsOwnershipMappingCreateRequest } from "../models/TeamsOwnershipMappingCreateRequest"; +import { TeamsOwnershipMappingResponse } from "../models/TeamsOwnershipMappingResponse"; +import { TeamsOwnershipMappingsResponse } from "../models/TeamsOwnershipMappingsResponse"; +import { TeamsOwnershipRulesResponse } from "../models/TeamsOwnershipRulesResponse"; + +export class RumTeamsOwnershipApiRequestFactory extends BaseAPIRequestFactory { + public async createTeamsOwnershipMapping( + body: TeamsOwnershipMappingCreateRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createTeamsOwnershipMapping'"); + if (!_config.unstableOperations["v2.createTeamsOwnershipMapping"]) { + throw new Error( + "Unstable operation 'createTeamsOwnershipMapping' is disabled" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createTeamsOwnershipMapping"); + } + + // Path Params + const localVarPath = "/api/v2/rum/config/teams-ownership/mappings"; + + // Make Request Context + const requestContext = _config + .getServer("v2.RumTeamsOwnershipApi.createTeamsOwnershipMapping") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "TeamsOwnershipMappingCreateRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async createTeamsOwnershipMappingsBatch( + body: TeamsOwnershipMappingBatchRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'createTeamsOwnershipMappingsBatch'"); + if (!_config.unstableOperations["v2.createTeamsOwnershipMappingsBatch"]) { + throw new Error( + "Unstable operation 'createTeamsOwnershipMappingsBatch' is disabled" + ); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createTeamsOwnershipMappingsBatch"); + } + + // Path Params + const localVarPath = + "/api/v2/rum/config/teams-ownership/mappings/operations"; + + // Make Request Context + const requestContext = _config + .getServer("v2.RumTeamsOwnershipApi.createTeamsOwnershipMappingsBatch") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "TeamsOwnershipMappingBatchRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async deleteTeamsOwnershipMapping( + id: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'deleteTeamsOwnershipMapping'"); + if (!_config.unstableOperations["v2.deleteTeamsOwnershipMapping"]) { + throw new Error( + "Unstable operation 'deleteTeamsOwnershipMapping' is disabled" + ); + } + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("id", "deleteTeamsOwnershipMapping"); + } + + // Path Params + const localVarPath = + "/api/v2/rum/config/teams-ownership/mappings/{id}".replace( + "{id}", + encodeURIComponent(String(id)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.RumTeamsOwnershipApi.deleteTeamsOwnershipMapping") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getTeamsOwnershipMapping( + id: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'getTeamsOwnershipMapping'"); + if (!_config.unstableOperations["v2.getTeamsOwnershipMapping"]) { + throw new Error( + "Unstable operation 'getTeamsOwnershipMapping' is disabled" + ); + } + + // verify required parameter 'id' is not null or undefined + if (id === null || id === undefined) { + throw new RequiredError("id", "getTeamsOwnershipMapping"); + } + + // Path Params + const localVarPath = + "/api/v2/rum/config/teams-ownership/mappings/{id}".replace( + "{id}", + encodeURIComponent(String(id)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.RumTeamsOwnershipApi.getTeamsOwnershipMapping") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listTeamsOwnershipMappings( + filterViewName?: Array, + filterTeamHandle?: Array, + filterApplicationId?: Array, + filterService?: Array, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listTeamsOwnershipMappings'"); + if (!_config.unstableOperations["v2.listTeamsOwnershipMappings"]) { + throw new Error( + "Unstable operation 'listTeamsOwnershipMappings' is disabled" + ); + } + + // Path Params + const localVarPath = "/api/v2/rum/config/teams-ownership/mappings"; + + // Make Request Context + const requestContext = _config + .getServer("v2.RumTeamsOwnershipApi.listTeamsOwnershipMappings") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (filterViewName !== undefined) { + requestContext.setQueryParam( + "filter[view_name]", + ObjectSerializer.serialize(filterViewName, "Array", ""), + "multi" + ); + } + if (filterTeamHandle !== undefined) { + requestContext.setQueryParam( + "filter[team_handle]", + ObjectSerializer.serialize(filterTeamHandle, "Array", ""), + "multi" + ); + } + if (filterApplicationId !== undefined) { + requestContext.setQueryParam( + "filter[application_id]", + ObjectSerializer.serialize( + filterApplicationId, + "Array", + "uuid" + ), + "multi" + ); + } + if (filterService !== undefined) { + requestContext.setQueryParam( + "filter[service]", + ObjectSerializer.serialize(filterService, "Array", ""), + "multi" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async listTeamsOwnershipRules( + filterViewName?: Array, + filterTeamHandle?: Array, + filterApplicationId?: Array, + filterService?: Array, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + logger.warn("Using unstable operation 'listTeamsOwnershipRules'"); + if (!_config.unstableOperations["v2.listTeamsOwnershipRules"]) { + throw new Error( + "Unstable operation 'listTeamsOwnershipRules' is disabled" + ); + } + + // Path Params + const localVarPath = "/api/v2/rum/config/teams-ownership/rules"; + + // Make Request Context + const requestContext = _config + .getServer("v2.RumTeamsOwnershipApi.listTeamsOwnershipRules") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (filterViewName !== undefined) { + requestContext.setQueryParam( + "filter[view_name]", + ObjectSerializer.serialize(filterViewName, "Array", ""), + "multi" + ); + } + if (filterTeamHandle !== undefined) { + requestContext.setQueryParam( + "filter[team_handle]", + ObjectSerializer.serialize(filterTeamHandle, "Array", ""), + "multi" + ); + } + if (filterApplicationId !== undefined) { + requestContext.setQueryParam( + "filter[application_id]", + ObjectSerializer.serialize( + filterApplicationId, + "Array", + "uuid" + ), + "multi" + ); + } + if (filterService !== undefined) { + requestContext.setQueryParam( + "filter[service]", + ObjectSerializer.serialize(filterService, "Array", ""), + "multi" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class RumTeamsOwnershipApiResponseProcessor { + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createTeamsOwnershipMapping + * @throws ApiException if the response code was not in [200, 299] + */ + public async createTeamsOwnershipMapping( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 201) { + const body: TeamsOwnershipMappingResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamsOwnershipMappingResponse" + ) as TeamsOwnershipMappingResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TeamsOwnershipMappingResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamsOwnershipMappingResponse", + "" + ) as TeamsOwnershipMappingResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to createTeamsOwnershipMappingsBatch + * @throws ApiException if the response code was not in [200, 299] + */ + public async createTeamsOwnershipMappingsBatch( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: TeamsOwnershipMappingBatchResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamsOwnershipMappingBatchResponse" + ) as TeamsOwnershipMappingBatchResponse; + return body; + } + if (response.httpStatusCode === 400) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: JSONAPIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "JSONAPIErrorResponse" + ) as JSONAPIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException( + response.httpStatusCode, + body + ); + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TeamsOwnershipMappingBatchResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamsOwnershipMappingBatchResponse", + "" + ) as TeamsOwnershipMappingBatchResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to deleteTeamsOwnershipMapping + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteTeamsOwnershipMapping( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + return; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getTeamsOwnershipMapping + * @throws ApiException if the response code was not in [200, 299] + */ + public async getTeamsOwnershipMapping( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: TeamsOwnershipMappingResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamsOwnershipMappingResponse" + ) as TeamsOwnershipMappingResponse; + return body; + } + if ( + response.httpStatusCode === 403 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TeamsOwnershipMappingResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamsOwnershipMappingResponse", + "" + ) as TeamsOwnershipMappingResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listTeamsOwnershipMappings + * @throws ApiException if the response code was not in [200, 299] + */ + public async listTeamsOwnershipMappings( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: TeamsOwnershipMappingsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamsOwnershipMappingsResponse" + ) as TeamsOwnershipMappingsResponse; + return body; + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TeamsOwnershipMappingsResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamsOwnershipMappingsResponse", + "" + ) as TeamsOwnershipMappingsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to listTeamsOwnershipRules + * @throws ApiException if the response code was not in [200, 299] + */ + public async listTeamsOwnershipRules( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: TeamsOwnershipRulesResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamsOwnershipRulesResponse" + ) as TeamsOwnershipRulesResponse; + return body; + } + if (response.httpStatusCode === 403 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: TeamsOwnershipRulesResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "TeamsOwnershipRulesResponse", + "" + ) as TeamsOwnershipRulesResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } +} + +export interface RumTeamsOwnershipApiCreateTeamsOwnershipMappingRequest { + /** + * The definition of the teams ownership mapping to create. + * @type TeamsOwnershipMappingCreateRequest + */ + body: TeamsOwnershipMappingCreateRequest; +} + +export interface RumTeamsOwnershipApiCreateTeamsOwnershipMappingsBatchRequest { + /** + * The ordered list of add and remove operations to apply atomically. + * @type TeamsOwnershipMappingBatchRequest + */ + body: TeamsOwnershipMappingBatchRequest; +} + +export interface RumTeamsOwnershipApiDeleteTeamsOwnershipMappingRequest { + /** + * The ID of the teams ownership mapping. + * @type string + */ + id: string; +} + +export interface RumTeamsOwnershipApiGetTeamsOwnershipMappingRequest { + /** + * The ID of the teams ownership mapping. + * @type string + */ + id: string; +} + +export interface RumTeamsOwnershipApiListTeamsOwnershipMappingsRequest { + /** + * Filter mappings by RUM view name. + * @type Array + */ + filterViewName?: Array; + /** + * Filter mappings by owning team handle. + * @type Array + */ + filterTeamHandle?: Array; + /** + * Filter mappings by RUM application ID. Each value must be a valid UUID. + * @type Array + */ + filterApplicationId?: Array; + /** + * Filter mappings by RUM application service name. + * @type Array + */ + filterService?: Array; +} + +export interface RumTeamsOwnershipApiListTeamsOwnershipRulesRequest { + /** + * Filter mappings by RUM view name. + * @type Array + */ + filterViewName?: Array; + /** + * Filter mappings by owning team handle. + * @type Array + */ + filterTeamHandle?: Array; + /** + * Filter mappings by RUM application ID. Each value must be a valid UUID. + * @type Array + */ + filterApplicationId?: Array; + /** + * Filter mappings by RUM application service name. + * @type Array + */ + filterService?: Array; +} + +export class RumTeamsOwnershipApi { + private requestFactory: RumTeamsOwnershipApiRequestFactory; + private responseProcessor: RumTeamsOwnershipApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: RumTeamsOwnershipApiRequestFactory, + responseProcessor?: RumTeamsOwnershipApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || new RumTeamsOwnershipApiRequestFactory(configuration); + this.responseProcessor = + responseProcessor || new RumTeamsOwnershipApiResponseProcessor(); + } + + /** + * Create a teams ownership mapping for your organization. + * Returns the teams ownership mapping object from the request body when the request is successful. + * @param param The request object + */ + public createTeamsOwnershipMapping( + param: RumTeamsOwnershipApiCreateTeamsOwnershipMappingRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.createTeamsOwnershipMapping(param.body, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createTeamsOwnershipMapping( + responseContext + ); + }); + }); + } + + /** + * 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. + * @param param The request object + */ + public createTeamsOwnershipMappingsBatch( + param: RumTeamsOwnershipApiCreateTeamsOwnershipMappingsBatchRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.createTeamsOwnershipMappingsBatch( + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createTeamsOwnershipMappingsBatch( + responseContext + ); + }); + }); + } + + /** + * Delete a specific teams ownership mapping from your organization. + * @param param The request object + */ + public deleteTeamsOwnershipMapping( + param: RumTeamsOwnershipApiDeleteTeamsOwnershipMappingRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.deleteTeamsOwnershipMapping(param.id, options); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteTeamsOwnershipMapping( + responseContext + ); + }); + }); + } + + /** + * Get a specific teams ownership mapping from your organization. + * @param param The request object + */ + public getTeamsOwnershipMapping( + param: RumTeamsOwnershipApiGetTeamsOwnershipMappingRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getTeamsOwnershipMapping( + param.id, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getTeamsOwnershipMapping( + responseContext + ); + }); + }); + } + + /** + * Get the list of teams ownership mappings for your organization, optionally filtered. + * @param param The request object + */ + public listTeamsOwnershipMappings( + param: RumTeamsOwnershipApiListTeamsOwnershipMappingsRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listTeamsOwnershipMappings( + param.filterViewName, + param.filterTeamHandle, + param.filterApplicationId, + param.filterService, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listTeamsOwnershipMappings( + responseContext + ); + }); + }); + } + + /** + * 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 param The request object + */ + public listTeamsOwnershipRules( + param: RumTeamsOwnershipApiListTeamsOwnershipRulesRequest = {}, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.listTeamsOwnershipRules( + param.filterViewName, + param.filterTeamHandle, + param.filterApplicationId, + param.filterService, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listTeamsOwnershipRules( + responseContext + ); + }); + }); + } +} diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 5919e1acdbb1..04c3592b6201 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -1383,6 +1383,16 @@ export { RumRetentionFiltersApi, } from "./apis/RumRetentionFiltersApi"; +export { + RumTeamsOwnershipApiCreateTeamsOwnershipMappingRequest, + RumTeamsOwnershipApiCreateTeamsOwnershipMappingsBatchRequest, + RumTeamsOwnershipApiDeleteTeamsOwnershipMappingRequest, + RumTeamsOwnershipApiGetTeamsOwnershipMappingRequest, + RumTeamsOwnershipApiListTeamsOwnershipMappingsRequest, + RumTeamsOwnershipApiListTeamsOwnershipRulesRequest, + RumTeamsOwnershipApi, +} from "./apis/RumTeamsOwnershipApi"; + export { SalesforceIntegrationApiCreateIncidentTemplateRequest, SalesforceIntegrationApiDeleteIncidentTemplateRequest, @@ -8765,6 +8775,30 @@ export { TeamsField } from "./models/TeamsField"; export { TeamsHierarchyLinksResponseLinks } from "./models/TeamsHierarchyLinksResponseLinks"; export { TeamsHierarchyLinksResponseMeta } from "./models/TeamsHierarchyLinksResponseMeta"; export { TeamsHierarchyLinksResponseMetaPage } from "./models/TeamsHierarchyLinksResponseMetaPage"; +export { TeamsOwnershipMappingBatchError } from "./models/TeamsOwnershipMappingBatchError"; +export { TeamsOwnershipMappingBatchOperation } from "./models/TeamsOwnershipMappingBatchOperation"; +export { TeamsOwnershipMappingBatchOperationData } from "./models/TeamsOwnershipMappingBatchOperationData"; +export { TeamsOwnershipMappingBatchOperationDataAttributes } from "./models/TeamsOwnershipMappingBatchOperationDataAttributes"; +export { TeamsOwnershipMappingBatchOperationOp } from "./models/TeamsOwnershipMappingBatchOperationOp"; +export { TeamsOwnershipMappingBatchOperationRef } from "./models/TeamsOwnershipMappingBatchOperationRef"; +export { TeamsOwnershipMappingBatchRequest } from "./models/TeamsOwnershipMappingBatchRequest"; +export { TeamsOwnershipMappingBatchResponse } from "./models/TeamsOwnershipMappingBatchResponse"; +export { TeamsOwnershipMappingBatchResult } from "./models/TeamsOwnershipMappingBatchResult"; +export { TeamsOwnershipMappingBatchResultData } from "./models/TeamsOwnershipMappingBatchResultData"; +export { TeamsOwnershipMappingCreateData } from "./models/TeamsOwnershipMappingCreateData"; +export { TeamsOwnershipMappingCreateDataAttributes } from "./models/TeamsOwnershipMappingCreateDataAttributes"; +export { TeamsOwnershipMappingCreateRequest } from "./models/TeamsOwnershipMappingCreateRequest"; +export { TeamsOwnershipMappingResponse } from "./models/TeamsOwnershipMappingResponse"; +export { TeamsOwnershipMappingResponseAttributes } from "./models/TeamsOwnershipMappingResponseAttributes"; +export { TeamsOwnershipMappingResponseData } from "./models/TeamsOwnershipMappingResponseData"; +export { TeamsOwnershipMappingsResponse } from "./models/TeamsOwnershipMappingsResponse"; +export { TeamsOwnershipMappingType } from "./models/TeamsOwnershipMappingType"; +export { TeamsOwnershipMatchType } from "./models/TeamsOwnershipMatchType"; +export { TeamsOwnershipRuleResponseAttributes } from "./models/TeamsOwnershipRuleResponseAttributes"; +export { TeamsOwnershipRuleResponseData } from "./models/TeamsOwnershipRuleResponseData"; +export { TeamsOwnershipRulesResponse } from "./models/TeamsOwnershipRulesResponse"; +export { TeamsOwnershipRuleTeamMapping } from "./models/TeamsOwnershipRuleTeamMapping"; +export { TeamsOwnershipRuleType } from "./models/TeamsOwnershipRuleType"; export { TeamsResponse } from "./models/TeamsResponse"; export { TeamsResponseLinks } from "./models/TeamsResponseLinks"; export { TeamsResponseMeta } from "./models/TeamsResponseMeta"; diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 36fdf0e95aad..f7ecea41b247 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -5310,6 +5310,26 @@ import { TeamUpdateRequest } from "./TeamUpdateRequest"; import { TeamsHierarchyLinksResponseLinks } from "./TeamsHierarchyLinksResponseLinks"; import { TeamsHierarchyLinksResponseMeta } from "./TeamsHierarchyLinksResponseMeta"; import { TeamsHierarchyLinksResponseMetaPage } from "./TeamsHierarchyLinksResponseMetaPage"; +import { TeamsOwnershipMappingBatchError } from "./TeamsOwnershipMappingBatchError"; +import { TeamsOwnershipMappingBatchOperation } from "./TeamsOwnershipMappingBatchOperation"; +import { TeamsOwnershipMappingBatchOperationData } from "./TeamsOwnershipMappingBatchOperationData"; +import { TeamsOwnershipMappingBatchOperationDataAttributes } from "./TeamsOwnershipMappingBatchOperationDataAttributes"; +import { TeamsOwnershipMappingBatchOperationRef } from "./TeamsOwnershipMappingBatchOperationRef"; +import { TeamsOwnershipMappingBatchRequest } from "./TeamsOwnershipMappingBatchRequest"; +import { TeamsOwnershipMappingBatchResponse } from "./TeamsOwnershipMappingBatchResponse"; +import { TeamsOwnershipMappingBatchResult } from "./TeamsOwnershipMappingBatchResult"; +import { TeamsOwnershipMappingBatchResultData } from "./TeamsOwnershipMappingBatchResultData"; +import { TeamsOwnershipMappingCreateData } from "./TeamsOwnershipMappingCreateData"; +import { TeamsOwnershipMappingCreateDataAttributes } from "./TeamsOwnershipMappingCreateDataAttributes"; +import { TeamsOwnershipMappingCreateRequest } from "./TeamsOwnershipMappingCreateRequest"; +import { TeamsOwnershipMappingResponse } from "./TeamsOwnershipMappingResponse"; +import { TeamsOwnershipMappingResponseAttributes } from "./TeamsOwnershipMappingResponseAttributes"; +import { TeamsOwnershipMappingResponseData } from "./TeamsOwnershipMappingResponseData"; +import { TeamsOwnershipMappingsResponse } from "./TeamsOwnershipMappingsResponse"; +import { TeamsOwnershipRuleResponseAttributes } from "./TeamsOwnershipRuleResponseAttributes"; +import { TeamsOwnershipRuleResponseData } from "./TeamsOwnershipRuleResponseData"; +import { TeamsOwnershipRuleTeamMapping } from "./TeamsOwnershipRuleTeamMapping"; +import { TeamsOwnershipRulesResponse } from "./TeamsOwnershipRulesResponse"; import { TeamsResponse } from "./TeamsResponse"; import { TeamsResponseLinks } from "./TeamsResponseLinks"; import { TeamsResponseMeta } from "./TeamsResponseMeta"; @@ -8585,6 +8605,10 @@ const enumsMap: { [key: string]: any[] } = { "team_links", "user_team_permissions", ], + TeamsOwnershipMappingBatchOperationOp: ["add", "remove"], + TeamsOwnershipMappingType: ["teams_ownership_mappings"], + TeamsOwnershipMatchType: ["exact", "prefix"], + TeamsOwnershipRuleType: ["teams_ownership_grouped_mappings"], TenancyProductsDataType: ["oci_tenancy_product"], TestOptimizationDeleteServiceSettingsRequestDataType: [ "test_optimization_delete_service_settings_request", @@ -15262,6 +15286,31 @@ const typeMap: { [index: string]: any } = { TeamsHierarchyLinksResponseLinks: TeamsHierarchyLinksResponseLinks, TeamsHierarchyLinksResponseMeta: TeamsHierarchyLinksResponseMeta, TeamsHierarchyLinksResponseMetaPage: TeamsHierarchyLinksResponseMetaPage, + TeamsOwnershipMappingBatchError: TeamsOwnershipMappingBatchError, + TeamsOwnershipMappingBatchOperation: TeamsOwnershipMappingBatchOperation, + TeamsOwnershipMappingBatchOperationData: + TeamsOwnershipMappingBatchOperationData, + TeamsOwnershipMappingBatchOperationDataAttributes: + TeamsOwnershipMappingBatchOperationDataAttributes, + TeamsOwnershipMappingBatchOperationRef: + TeamsOwnershipMappingBatchOperationRef, + TeamsOwnershipMappingBatchRequest: TeamsOwnershipMappingBatchRequest, + TeamsOwnershipMappingBatchResponse: TeamsOwnershipMappingBatchResponse, + TeamsOwnershipMappingBatchResult: TeamsOwnershipMappingBatchResult, + TeamsOwnershipMappingBatchResultData: TeamsOwnershipMappingBatchResultData, + TeamsOwnershipMappingCreateData: TeamsOwnershipMappingCreateData, + TeamsOwnershipMappingCreateDataAttributes: + TeamsOwnershipMappingCreateDataAttributes, + TeamsOwnershipMappingCreateRequest: TeamsOwnershipMappingCreateRequest, + TeamsOwnershipMappingResponse: TeamsOwnershipMappingResponse, + TeamsOwnershipMappingResponseAttributes: + TeamsOwnershipMappingResponseAttributes, + TeamsOwnershipMappingResponseData: TeamsOwnershipMappingResponseData, + TeamsOwnershipMappingsResponse: TeamsOwnershipMappingsResponse, + TeamsOwnershipRuleResponseAttributes: TeamsOwnershipRuleResponseAttributes, + TeamsOwnershipRuleResponseData: TeamsOwnershipRuleResponseData, + TeamsOwnershipRuleTeamMapping: TeamsOwnershipRuleTeamMapping, + TeamsOwnershipRulesResponse: TeamsOwnershipRulesResponse, TeamsResponse: TeamsResponse, TeamsResponseLinks: TeamsResponseLinks, TeamsResponseMeta: TeamsResponseMeta, diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchError.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchError.ts new file mode 100644 index 000000000000..fe398fa99a15 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchError.ts @@ -0,0 +1,70 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * An error encountered while validating or applying an operation. + */ +export class TeamsOwnershipMappingBatchError { + /** + * A human-readable explanation specific to this error. + */ + "detail"?: string; + /** + * The HTTP status code applicable to this error. + */ + "status": string; + /** + * A short, human-readable summary of the error. + */ + "title": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + detail: { + baseName: "detail", + type: "string", + }, + status: { + baseName: "status", + type: "string", + required: true, + }, + title: { + baseName: "title", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingBatchError.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperation.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperation.ts new file mode 100644 index 000000000000..24ec3eb4927d --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperation.ts @@ -0,0 +1,72 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMappingBatchOperationData } from "./TeamsOwnershipMappingBatchOperationData"; +import { TeamsOwnershipMappingBatchOperationOp } from "./TeamsOwnershipMappingBatchOperationOp"; +import { TeamsOwnershipMappingBatchOperationRef } from "./TeamsOwnershipMappingBatchOperationRef"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A single add or remove operation, applied atomically with every other operation in the request. + */ +export class TeamsOwnershipMappingBatchOperation { + /** + * The mapping to add. Required when `op` is `add`. + */ + "data"?: TeamsOwnershipMappingBatchOperationData; + /** + * Whether this operation adds a new mapping or removes an existing one. + */ + "op": TeamsOwnershipMappingBatchOperationOp; + /** + * Identifies an existing mapping to remove. Required when `op` is `remove`. + */ + "ref"?: TeamsOwnershipMappingBatchOperationRef; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "TeamsOwnershipMappingBatchOperationData", + }, + op: { + baseName: "op", + type: "TeamsOwnershipMappingBatchOperationOp", + required: true, + }, + ref: { + baseName: "ref", + type: "TeamsOwnershipMappingBatchOperationRef", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingBatchOperation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationData.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationData.ts new file mode 100644 index 000000000000..d8f51ff25d6f --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationData.ts @@ -0,0 +1,65 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMappingBatchOperationDataAttributes } from "./TeamsOwnershipMappingBatchOperationDataAttributes"; +import { TeamsOwnershipMappingType } from "./TeamsOwnershipMappingType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The mapping to add. Required when `op` is `add`. + */ +export class TeamsOwnershipMappingBatchOperationData { + /** + * The attributes of the mapping to add. `team_handle` and `view_name` are required + * when `op` is `add`. + */ + "attributes": TeamsOwnershipMappingBatchOperationDataAttributes; + /** + * The type of the resource. The value should always be teams_ownership_mappings. + */ + "type": TeamsOwnershipMappingType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "TeamsOwnershipMappingBatchOperationDataAttributes", + required: true, + }, + type: { + baseName: "type", + type: "TeamsOwnershipMappingType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingBatchOperationData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationDataAttributes.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationDataAttributes.ts new file mode 100644 index 000000000000..c1ee676c5a9f --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationDataAttributes.ts @@ -0,0 +1,89 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMatchType } from "./TeamsOwnershipMatchType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The attributes of the mapping to add. `team_handle` and `view_name` are required + * when `op` is `add`. + */ +export class TeamsOwnershipMappingBatchOperationDataAttributes { + /** + * 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. + */ + "applicationId"?: string; + /** + * How the `view_name` is matched against RUM view names. + */ + "matchType"?: TeamsOwnershipMatchType; + /** + * 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. + */ + "service"?: string; + /** + * The handle of the team that owns the matched RUM views. + */ + "teamHandle"?: string; + /** + * The RUM view name to match, or its prefix when `match_type` is `prefix`. + */ + "viewName"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + applicationId: { + baseName: "application_id", + type: "string", + format: "uuid", + }, + matchType: { + baseName: "match_type", + type: "TeamsOwnershipMatchType", + }, + service: { + baseName: "service", + type: "string", + }, + teamHandle: { + baseName: "team_handle", + type: "string", + }, + viewName: { + baseName: "view_name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingBatchOperationDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationOp.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationOp.ts new file mode 100644 index 000000000000..9763c3277550 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationOp.ts @@ -0,0 +1,18 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Whether this operation adds a new mapping or removes an existing one. + */ + +export type TeamsOwnershipMappingBatchOperationOp = + | typeof ADD + | typeof REMOVE + | UnparsedObject; +export const ADD = "add"; +export const REMOVE = "remove"; diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationRef.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationRef.ts new file mode 100644 index 000000000000..95ad49159f2a --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchOperationRef.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMappingType } from "./TeamsOwnershipMappingType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Identifies an existing mapping to remove. Required when `op` is `remove`. + */ +export class TeamsOwnershipMappingBatchOperationRef { + /** + * The ID of the mapping to remove. + */ + "id": string; + /** + * The type of the resource. The value should always be teams_ownership_mappings. + */ + "type": TeamsOwnershipMappingType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "TeamsOwnershipMappingType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingBatchOperationRef.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchRequest.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchRequest.ts new file mode 100644 index 000000000000..40e16d55686a --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMappingBatchOperation } from "./TeamsOwnershipMappingBatchOperation"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The request body for bulk-creating and bulk-removing teams ownership mappings. + */ +export class TeamsOwnershipMappingBatchRequest { + /** + * The ordered list of add and remove operations to apply atomically. + */ + "atomicOperations": Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + atomicOperations: { + baseName: "atomic:operations", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingBatchRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchResponse.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchResponse.ts new file mode 100644 index 000000000000..931dc50efe74 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchResponse.ts @@ -0,0 +1,66 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMappingBatchError } from "./TeamsOwnershipMappingBatchError"; +import { TeamsOwnershipMappingBatchResult } from "./TeamsOwnershipMappingBatchResult"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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. + */ +export class TeamsOwnershipMappingBatchResponse { + /** + * 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. + */ + "atomicResults"?: Array; + /** + * The validation or processing errors encountered. Present only when the request could not be completed. + */ + "errors"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + atomicResults: { + baseName: "atomic:results", + type: "Array", + }, + errors: { + baseName: "errors", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingBatchResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchResult.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchResult.ts new file mode 100644 index 000000000000..dfd34c796762 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchResult.ts @@ -0,0 +1,55 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMappingBatchResultData } from "./TeamsOwnershipMappingBatchResultData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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. + */ +export class TeamsOwnershipMappingBatchResult { + /** + * The mapping created by an `add` operation. + */ + "data"?: TeamsOwnershipMappingBatchResultData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "TeamsOwnershipMappingBatchResultData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingBatchResult.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchResultData.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchResultData.ts new file mode 100644 index 000000000000..a1d8098b43ea --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingBatchResultData.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMappingResponseAttributes } from "./TeamsOwnershipMappingResponseAttributes"; +import { TeamsOwnershipMappingType } from "./TeamsOwnershipMappingType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The mapping created by an `add` operation. + */ +export class TeamsOwnershipMappingBatchResultData { + /** + * The attributes of a teams ownership mapping. + */ + "attributes": TeamsOwnershipMappingResponseAttributes; + /** + * The unique identifier of the teams ownership mapping. + */ + "id": string; + /** + * The type of the resource. The value should always be teams_ownership_mappings. + */ + "type": TeamsOwnershipMappingType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "TeamsOwnershipMappingResponseAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "TeamsOwnershipMappingType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingBatchResultData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingCreateData.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingCreateData.ts new file mode 100644 index 000000000000..4beeba946898 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingCreateData.ts @@ -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 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMappingCreateDataAttributes } from "./TeamsOwnershipMappingCreateDataAttributes"; +import { TeamsOwnershipMappingType } from "./TeamsOwnershipMappingType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API data envelope for a teams ownership mapping create request. + */ +export class TeamsOwnershipMappingCreateData { + /** + * The attributes of the teams ownership mapping to create. + */ + "attributes": TeamsOwnershipMappingCreateDataAttributes; + /** + * The type of the resource. The value should always be teams_ownership_mappings. + */ + "type": TeamsOwnershipMappingType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "TeamsOwnershipMappingCreateDataAttributes", + required: true, + }, + type: { + baseName: "type", + type: "TeamsOwnershipMappingType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingCreateData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingCreateDataAttributes.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingCreateDataAttributes.ts new file mode 100644 index 000000000000..d580215aac9b --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingCreateDataAttributes.ts @@ -0,0 +1,90 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMatchType } from "./TeamsOwnershipMatchType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The attributes of the teams ownership mapping to create. + */ +export class TeamsOwnershipMappingCreateDataAttributes { + /** + * 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. + */ + "applicationId"?: string; + /** + * How the `view_name` is matched against RUM view names. + */ + "matchType"?: TeamsOwnershipMatchType; + /** + * 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. + */ + "service"?: string; + /** + * The handle of the team that owns the matched RUM views. + */ + "teamHandle": string; + /** + * The RUM view name to match, or its prefix when `match_type` is `prefix`. + */ + "viewName": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + applicationId: { + baseName: "application_id", + type: "string", + format: "uuid", + }, + matchType: { + baseName: "match_type", + type: "TeamsOwnershipMatchType", + }, + service: { + baseName: "service", + type: "string", + }, + teamHandle: { + baseName: "team_handle", + type: "string", + required: true, + }, + viewName: { + baseName: "view_name", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingCreateDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingCreateRequest.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingCreateRequest.ts new file mode 100644 index 000000000000..71d5c85628e7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingCreateRequest.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMappingCreateData } from "./TeamsOwnershipMappingCreateData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The request body for creating a teams ownership mapping. + */ +export class TeamsOwnershipMappingCreateRequest { + /** + * The JSON:API data envelope for a teams ownership mapping create request. + */ + "data": TeamsOwnershipMappingCreateData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "TeamsOwnershipMappingCreateData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingCreateRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingResponse.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingResponse.ts new file mode 100644 index 000000000000..202efdc7de5b --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingResponse.ts @@ -0,0 +1,54 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMappingResponseData } from "./TeamsOwnershipMappingResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The response body for a single teams ownership mapping. + */ +export class TeamsOwnershipMappingResponse { + /** + * The JSON:API data envelope for a teams ownership mapping. + */ + "data": TeamsOwnershipMappingResponseData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "TeamsOwnershipMappingResponseData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingResponseAttributes.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingResponseAttributes.ts new file mode 100644 index 000000000000..5ab60ae92b9d --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingResponseAttributes.ts @@ -0,0 +1,121 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMatchType } from "./TeamsOwnershipMatchType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The attributes of a teams ownership mapping. + */ +export class TeamsOwnershipMappingResponseAttributes { + /** + * 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. + */ + "applicationId": string; + /** + * Timestamp when the mapping was created. + */ + "createdAt": Date; + /** + * The UUID of the user who created the mapping. + */ + "createdBy": string; + /** + * How the `view_name` is matched against RUM view names. + */ + "matchType": TeamsOwnershipMatchType; + /** + * The ID of the organization that owns this mapping. + */ + "orgId": number; + /** + * The RUM application's service name. For browser applications, may be empty. For mobile applications, this is the service that scopes the ownership. + */ + "service": string; + /** + * The handle of the team that owns the matched RUM views. + */ + "teamHandle": string; + /** + * The RUM view name to match, or its prefix when `match_type` is `prefix`. + */ + "viewName": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + applicationId: { + baseName: "application_id", + type: "string", + required: true, + }, + createdAt: { + baseName: "created_at", + type: "Date", + required: true, + format: "date-time", + }, + createdBy: { + baseName: "created_by", + type: "string", + required: true, + }, + matchType: { + baseName: "match_type", + type: "TeamsOwnershipMatchType", + required: true, + }, + orgId: { + baseName: "org_id", + type: "number", + required: true, + format: "int64", + }, + service: { + baseName: "service", + type: "string", + required: true, + }, + teamHandle: { + baseName: "team_handle", + type: "string", + required: true, + }, + viewName: { + baseName: "view_name", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingResponseData.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingResponseData.ts new file mode 100644 index 000000000000..cc7f06491f93 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingResponseData.ts @@ -0,0 +1,73 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMappingResponseAttributes } from "./TeamsOwnershipMappingResponseAttributes"; +import { TeamsOwnershipMappingType } from "./TeamsOwnershipMappingType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API data envelope for a teams ownership mapping. + */ +export class TeamsOwnershipMappingResponseData { + /** + * The attributes of a teams ownership mapping. + */ + "attributes": TeamsOwnershipMappingResponseAttributes; + /** + * The unique identifier of the teams ownership mapping. + */ + "id": string; + /** + * The type of the resource. The value should always be teams_ownership_mappings. + */ + "type": TeamsOwnershipMappingType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "TeamsOwnershipMappingResponseAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "TeamsOwnershipMappingType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingType.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingType.ts new file mode 100644 index 000000000000..30ed8c37b705 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of the resource. The value should always be teams_ownership_mappings. + */ + +export type TeamsOwnershipMappingType = + | typeof TEAMS_OWNERSHIP_MAPPINGS + | UnparsedObject; +export const TEAMS_OWNERSHIP_MAPPINGS = "teams_ownership_mappings"; diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMappingsResponse.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingsResponse.ts new file mode 100644 index 000000000000..f25de9e46e9f --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMappingsResponse.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ResponseMetaAttributes } from "./ResponseMetaAttributes"; +import { TeamsOwnershipMappingResponseData } from "./TeamsOwnershipMappingResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The response body for a list of teams ownership mappings. + */ +export class TeamsOwnershipMappingsResponse { + /** + * A list of teams ownership mappings. + */ + "data": Array; + /** + * Object describing meta attributes of response. + */ + "meta"?: ResponseMetaAttributes; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + meta: { + baseName: "meta", + type: "ResponseMetaAttributes", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipMappingsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipMatchType.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipMatchType.ts new file mode 100644 index 000000000000..997b9de6b179 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipMatchType.ts @@ -0,0 +1,18 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * How the `view_name` is matched against RUM view names. + */ + +export type TeamsOwnershipMatchType = + | typeof EXACT + | typeof PREFIX + | UnparsedObject; +export const EXACT = "exact"; +export const PREFIX = "prefix"; diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipRuleResponseAttributes.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipRuleResponseAttributes.ts new file mode 100644 index 000000000000..96bb39ae97be --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipRuleResponseAttributes.ts @@ -0,0 +1,93 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipMatchType } from "./TeamsOwnershipMatchType"; +import { TeamsOwnershipRuleTeamMapping } from "./TeamsOwnershipRuleTeamMapping"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The attributes of a teams ownership rule. + */ +export class TeamsOwnershipRuleResponseAttributes { + /** + * 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. + */ + "applicationId": string; + /** + * How the `view_name` is matched against RUM view names. + */ + "matchType": TeamsOwnershipMatchType; + /** + * The RUM application's service name. For browser applications, may be empty. For mobile applications, this is the service that scopes the ownership. + */ + "service": string; + /** + * The teams that own the matched views, each paired with the ID of its underlying mapping. + */ + "teams": Array; + /** + * The RUM view name to match, or its prefix when `match_type` is `prefix`. + */ + "viewName": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + applicationId: { + baseName: "application_id", + type: "string", + required: true, + }, + matchType: { + baseName: "match_type", + type: "TeamsOwnershipMatchType", + required: true, + }, + service: { + baseName: "service", + type: "string", + required: true, + }, + teams: { + baseName: "teams", + type: "Array", + required: true, + }, + viewName: { + baseName: "view_name", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipRuleResponseAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipRuleResponseData.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipRuleResponseData.ts new file mode 100644 index 000000000000..0bd7611d7a35 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipRuleResponseData.ts @@ -0,0 +1,75 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { TeamsOwnershipRuleResponseAttributes } from "./TeamsOwnershipRuleResponseAttributes"; +import { TeamsOwnershipRuleType } from "./TeamsOwnershipRuleType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The JSON:API data envelope for a teams ownership rule. + */ +export class TeamsOwnershipRuleResponseData { + /** + * The attributes of a teams ownership rule. + */ + "attributes": TeamsOwnershipRuleResponseAttributes; + /** + * 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. + */ + "id": string; + /** + * The type of the resource. The value should always be teams_ownership_grouped_mappings. + */ + "type": TeamsOwnershipRuleType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "TeamsOwnershipRuleResponseAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "TeamsOwnershipRuleType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipRuleResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipRuleTeamMapping.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipRuleTeamMapping.ts new file mode 100644 index 000000000000..49d885ce79e2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipRuleTeamMapping.ts @@ -0,0 +1,62 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * An individual team's ownership entry within a teams ownership rule. + */ +export class TeamsOwnershipRuleTeamMapping { + /** + * The ID of the underlying mapping, used to delete this team's ownership individually. + */ + "mappingId": string; + /** + * The handle of the owning team. + */ + "teamHandle": string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + mappingId: { + baseName: "mapping_id", + type: "string", + required: true, + }, + teamHandle: { + baseName: "team_handle", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipRuleTeamMapping.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipRuleType.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipRuleType.ts new file mode 100644 index 000000000000..bc5f3f24c379 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipRuleType.ts @@ -0,0 +1,17 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * The type of the resource. The value should always be teams_ownership_grouped_mappings. + */ + +export type TeamsOwnershipRuleType = + | typeof TEAMS_OWNERSHIP_GROUPED_MAPPINGS + | UnparsedObject; +export const TEAMS_OWNERSHIP_GROUPED_MAPPINGS = + "teams_ownership_grouped_mappings"; diff --git a/packages/datadog-api-client-v2/models/TeamsOwnershipRulesResponse.ts b/packages/datadog-api-client-v2/models/TeamsOwnershipRulesResponse.ts new file mode 100644 index 000000000000..ef362f210aa6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/TeamsOwnershipRulesResponse.ts @@ -0,0 +1,63 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { ResponseMetaAttributes } from "./ResponseMetaAttributes"; +import { TeamsOwnershipRuleResponseData } from "./TeamsOwnershipRuleResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The response body for a list of teams ownership rules. + */ +export class TeamsOwnershipRulesResponse { + /** + * A list of teams ownership rules. + */ + "data": Array; + /** + * Object describing meta attributes of response. + */ + "meta"?: ResponseMetaAttributes; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + meta: { + baseName: "meta", + type: "ResponseMetaAttributes", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return TeamsOwnershipRulesResponse.attributeTypeMap; + } + + public constructor() {} +}