Skip to content

Commit 9fb6917

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add resource_type query param to authn mapping spec (#1641)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 6656c4d commit 9fb6917

File tree

7 files changed

+56
-4
lines changed

7 files changed

+56
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-07-18 19:52:49.687591",
8-
"spec_repo_commit": "17f1aa28"
7+
"regenerated": "2024-07-18 21:03:04.645182",
8+
"spec_repo_commit": "4e7a6907"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-07-18 19:52:49.706789",
13-
"spec_repo_commit": "17f1aa28"
12+
"regenerated": "2024-07-18 21:03:04.664418",
13+
"spec_repo_commit": "4e7a6907"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,15 @@ components:
13841384
team:
13851385
$ref: '#/components/schemas/RelationshipToTeam'
13861386
type: object
1387+
AuthNMappingResourceType:
1388+
description: The type of resource being mapped to.
1389+
enum:
1390+
- role
1391+
- team
1392+
type: string
1393+
x-enum-varnames:
1394+
- ROLE
1395+
- TEAM
13871396
AuthNMappingResponse:
13881397
description: AuthN Mapping response from the API.
13891398
properties:
@@ -24696,6 +24705,11 @@ paths:
2469624705
required: false
2469724706
schema:
2469824707
type: string
24708+
- description: Filter by mapping resource type. Defaults to "role" if not specified.
24709+
in: query
24710+
name: resource_type
24711+
schema:
24712+
$ref: '#/components/schemas/AuthNMappingResourceType'
2469924713
responses:
2470024714
'200':
2470124715
content:

features/support/scenarios_model_mapping.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,6 +2651,10 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
26512651
"type": "string",
26522652
"format": "",
26532653
},
2654+
"resourceType": {
2655+
"type": "AuthNMappingResourceType",
2656+
"format": "",
2657+
},
26542658
"operationResponseType": "AuthNMappingsResponse",
26552659
},
26562660
"v2.CreateAuthNMapping": {

packages/datadog-api-client-v2/apis/AuthNMappingsApi.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { ApiException } from "../../datadog-api-client-common/exception";
1818

1919
import { APIErrorResponse } from "../models/APIErrorResponse";
2020
import { AuthNMappingCreateRequest } from "../models/AuthNMappingCreateRequest";
21+
import { AuthNMappingResourceType } from "../models/AuthNMappingResourceType";
2122
import { AuthNMappingResponse } from "../models/AuthNMappingResponse";
2223
import { AuthNMappingsResponse } from "../models/AuthNMappingsResponse";
2324
import { AuthNMappingsSort } from "../models/AuthNMappingsSort";
@@ -138,6 +139,7 @@ export class AuthNMappingsApiRequestFactory extends BaseAPIRequestFactory {
138139
pageNumber?: number,
139140
sort?: AuthNMappingsSort,
140141
filter?: string,
142+
resourceType?: AuthNMappingResourceType,
141143
_options?: Configuration
142144
): Promise<RequestContext> {
143145
const _config = _options || this.configuration;
@@ -177,6 +179,12 @@ export class AuthNMappingsApiRequestFactory extends BaseAPIRequestFactory {
177179
ObjectSerializer.serialize(filter, "string", "")
178180
);
179181
}
182+
if (resourceType !== undefined) {
183+
requestContext.setQueryParam(
184+
"resource_type",
185+
ObjectSerializer.serialize(resourceType, "AuthNMappingResourceType", "")
186+
);
187+
}
180188

181189
// Apply auth methods
182190
applySecurityAuthentication(_config, requestContext, [
@@ -589,6 +597,11 @@ export interface AuthNMappingsApiListAuthNMappingsRequest {
589597
* @type string
590598
*/
591599
filter?: string;
600+
/**
601+
* Filter by mapping resource type. Defaults to "role" if not specified.
602+
* @type AuthNMappingResourceType
603+
*/
604+
resourceType?: AuthNMappingResourceType;
592605
}
593606

594607
export interface AuthNMappingsApiUpdateAuthNMappingRequest {
@@ -696,6 +709,7 @@ export class AuthNMappingsApi {
696709
param.pageNumber,
697710
param.sort,
698711
param.filter,
712+
param.resourceType,
699713
options
700714
);
701715
return requestContextPromise.then((requestContext) => {

packages/datadog-api-client-v2/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ export { AuthNMappingIncluded } from "./models/AuthNMappingIncluded";
571571
export { AuthNMappingRelationships } from "./models/AuthNMappingRelationships";
572572
export { AuthNMappingRelationshipToRole } from "./models/AuthNMappingRelationshipToRole";
573573
export { AuthNMappingRelationshipToTeam } from "./models/AuthNMappingRelationshipToTeam";
574+
export { AuthNMappingResourceType } from "./models/AuthNMappingResourceType";
574575
export { AuthNMappingResponse } from "./models/AuthNMappingResponse";
575576
export { AuthNMappingsResponse } from "./models/AuthNMappingsResponse";
576577
export { AuthNMappingsSort } from "./models/AuthNMappingsSort";
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
3+
* This product includes software developed at Datadog (https://www.datadoghq.com/).
4+
* Copyright 2020-Present Datadog, Inc.
5+
*/
6+
7+
import { UnparsedObject } from "../../datadog-api-client-common/util";
8+
9+
/**
10+
* The type of resource being mapped to.
11+
*/
12+
13+
export type AuthNMappingResourceType =
14+
| typeof ROLE
15+
| typeof TEAM
16+
| UnparsedObject;
17+
export const ROLE = "role";
18+
export const TEAM = "team";

packages/datadog-api-client-v2/models/ObjectSerializer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,7 @@ const enumsMap: { [key: string]: any[] } = {
12021202
AuditLogsEventType: ["audit"],
12031203
AuditLogsResponseStatus: ["done", "timeout"],
12041204
AuditLogsSort: ["timestamp", "-timestamp"],
1205+
AuthNMappingResourceType: ["role", "team"],
12051206
AuthNMappingsSort: [
12061207
"created_at",
12071208
"-created_at",

0 commit comments

Comments
 (0)