Skip to content

Commit 6acdfd1

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 81b4470 of spec repo (#4449)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 8191f8b commit 6acdfd1

12 files changed

Lines changed: 463 additions & 0 deletions

.generator/schemas/v2/openapi.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55468,6 +55468,40 @@ components:
5546855468
type: string
5546955469
x-enum-varnames:
5547055470
- MANAGED_ORGS
55471+
MaxSessionDurationType:
55472+
description: Data type of a maximum session duration update.
55473+
enum: [max_session_duration]
55474+
example: max_session_duration
55475+
type: string
55476+
x-enum-varnames:
55477+
- MAX_SESSION_DURATION
55478+
MaxSessionDurationUpdateAttributes:
55479+
description: Attributes for the maximum session duration update request.
55480+
properties:
55481+
max_session_duration:
55482+
description: The maximum session duration, in seconds.
55483+
example: 604800
55484+
format: int64
55485+
minimum: 1
55486+
type: integer
55487+
required: [max_session_duration]
55488+
type: object
55489+
MaxSessionDurationUpdateData:
55490+
description: The data object for a maximum session duration update request.
55491+
properties:
55492+
attributes:
55493+
$ref: "#/components/schemas/MaxSessionDurationUpdateAttributes"
55494+
type:
55495+
$ref: "#/components/schemas/MaxSessionDurationType"
55496+
required: [type, attributes]
55497+
type: object
55498+
MaxSessionDurationUpdateRequest:
55499+
description: A request to update the maximum session duration for an organization.
55500+
properties:
55501+
data:
55502+
$ref: "#/components/schemas/MaxSessionDurationUpdateData"
55503+
required: [data]
55504+
type: object
5547155505
McpScanRequest:
5547255506
description: The top-level request object for submitting an MCP SCA dependency scan.
5547355507
properties:
@@ -143303,6 +143337,47 @@ paths:
143303143337
x-unstable: |-
143304143338
**Note**: This endpoint is in preview and is subject to change.
143305143339
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
143340+
/api/v2/login/org_configs/max_session_duration:
143341+
put:
143342+
description: |-
143343+
Update the maximum session duration for the current organization.
143344+
The duration is specified in seconds.
143345+
operationId: UpdateLoginOrgConfigsMaxSessionDuration
143346+
requestBody:
143347+
content:
143348+
application/json:
143349+
examples:
143350+
default:
143351+
value:
143352+
data:
143353+
attributes:
143354+
max_session_duration: 604800
143355+
type: max_session_duration
143356+
schema:
143357+
$ref: "#/components/schemas/MaxSessionDurationUpdateRequest"
143358+
required: true
143359+
responses:
143360+
"204":
143361+
description: No Content
143362+
"400":
143363+
$ref: "#/components/responses/BadRequestResponse"
143364+
"401":
143365+
$ref: "#/components/responses/UnauthorizedResponse"
143366+
"403":
143367+
$ref: "#/components/responses/ForbiddenResponse"
143368+
"429":
143369+
$ref: "#/components/responses/TooManyRequestsResponse"
143370+
security:
143371+
- apiKeyAuth: []
143372+
appKeyAuth: []
143373+
- AuthZ:
143374+
- org_management
143375+
summary: Update the maximum session duration
143376+
tags: [Organizations]
143377+
"x-permission":
143378+
operator: OR
143379+
permissions:
143380+
- org_management
143306143381
/api/v2/logs:
143307143382
post:
143308143383
description: |-
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/**
2+
* Update the maximum session duration returns "No Content" response
3+
*/
4+
5+
import { client, v2 } from "@datadog/datadog-api-client";
6+
7+
const configuration = client.createConfiguration();
8+
const apiInstance = new v2.OrganizationsApi(configuration);
9+
10+
const params: v2.OrganizationsApiUpdateLoginOrgConfigsMaxSessionDurationRequest =
11+
{
12+
body: {
13+
data: {
14+
attributes: {
15+
maxSessionDuration: 604800,
16+
},
17+
type: "max_session_duration",
18+
},
19+
},
20+
};
21+
22+
apiInstance
23+
.updateLoginOrgConfigsMaxSessionDuration(params)
24+
.then((data: any) => {
25+
console.log(
26+
"API called successfully. Returned data: " + JSON.stringify(data)
27+
);
28+
})
29+
.catch((error: any) => console.error(error));

features/support/scenarios_model_mapping.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9150,6 +9150,13 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = {
91509150
},
91519151
"operationResponseType": "GlobalOrgsResponse",
91529152
},
9153+
"v2.UpdateLoginOrgConfigsMaxSessionDuration": {
9154+
"body": {
9155+
"type": "MaxSessionDurationUpdateRequest",
9156+
"format": "",
9157+
},
9158+
"operationResponseType": "{}",
9159+
},
91539160
"v2.ListOrgs": {
91549161
"filterName": {
91559162
"type": "string",

features/v2/organizations.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,20 @@ Feature: Organizations
168168
When the request is sent
169169
Then the response status is 404 Not Found
170170

171+
@generated @skip @team:DataDog/delegated-auth-login
172+
Scenario: Update the maximum session duration returns "Bad Request" response
173+
Given new "UpdateLoginOrgConfigsMaxSessionDuration" request
174+
And body with value {"data": {"attributes": {"max_session_duration": 604800}, "type": "max_session_duration"}}
175+
When the request is sent
176+
Then the response status is 400 Bad Request
177+
178+
@generated @skip @team:DataDog/delegated-auth-login
179+
Scenario: Update the maximum session duration returns "No Content" response
180+
Given new "UpdateLoginOrgConfigsMaxSessionDuration" request
181+
And body with value {"data": {"attributes": {"max_session_duration": 604800}, "type": "max_session_duration"}}
182+
When the request is sent
183+
Then the response status is 204 No Content
184+
171185
@skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/delegated-auth-login
172186
Scenario: Upload IdP metadata returns "Bad Request - caused by either malformed XML or invalid SAML IdP metadata" response
173187
Given new "UploadIdPMetadata" request

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4560,6 +4560,12 @@
45604560
"type": "safe"
45614561
}
45624562
},
4563+
"UpdateLoginOrgConfigsMaxSessionDuration": {
4564+
"tag": "Organizations",
4565+
"undo": {
4566+
"type": "idempotent"
4567+
}
4568+
},
45634569
"SubmitLog": {
45644570
"tag": "Logs",
45654571
"undo": {

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

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { GlobalOrgData } from "../models/GlobalOrgData";
2424
import { GlobalOrgsResponse } from "../models/GlobalOrgsResponse";
2525
import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse";
2626
import { ManagedOrgsResponse } from "../models/ManagedOrgsResponse";
27+
import { MaxSessionDurationUpdateRequest } from "../models/MaxSessionDurationUpdateRequest";
2728
import { OrgConfigGetResponse } from "../models/OrgConfigGetResponse";
2829
import { OrgConfigListResponse } from "../models/OrgConfigListResponse";
2930
import { OrgConfigWriteRequest } from "../models/OrgConfigWriteRequest";
@@ -239,6 +240,51 @@ export class OrganizationsApiRequestFactory extends BaseAPIRequestFactory {
239240
return requestContext;
240241
}
241242

243+
public async updateLoginOrgConfigsMaxSessionDuration(
244+
body: MaxSessionDurationUpdateRequest,
245+
_options?: Configuration
246+
): Promise<RequestContext> {
247+
const _config = _options || this.configuration;
248+
249+
// verify required parameter 'body' is not null or undefined
250+
if (body === null || body === undefined) {
251+
throw new RequiredError(
252+
"body",
253+
"updateLoginOrgConfigsMaxSessionDuration"
254+
);
255+
}
256+
257+
// Path Params
258+
const localVarPath = "/api/v2/login/org_configs/max_session_duration";
259+
260+
// Make Request Context
261+
const requestContext = _config
262+
.getServer("v2.OrganizationsApi.updateLoginOrgConfigsMaxSessionDuration")
263+
.makeRequestContext(localVarPath, HttpMethod.PUT);
264+
requestContext.setHeaderParam("Accept", "*/*");
265+
requestContext.setHttpConfig(_config.httpConfig);
266+
267+
// Body Params
268+
const contentType = ObjectSerializer.getPreferredMediaType([
269+
"application/json",
270+
]);
271+
requestContext.setHeaderParam("Content-Type", contentType);
272+
const serializedBody = ObjectSerializer.stringify(
273+
ObjectSerializer.serialize(body, "MaxSessionDurationUpdateRequest", ""),
274+
contentType
275+
);
276+
requestContext.setBody(serializedBody);
277+
278+
// Apply auth methods
279+
applySecurityAuthentication(_config, requestContext, [
280+
"apiKeyAuth",
281+
"appKeyAuth",
282+
"AuthZ",
283+
]);
284+
285+
return requestContext;
286+
}
287+
242288
public async updateOrgConfig(
243289
orgConfigName: string,
244290
body: OrgConfigWriteRequest,
@@ -795,6 +841,60 @@ export class OrganizationsApiResponseProcessor {
795841
);
796842
}
797843

844+
/**
845+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
846+
* to the expected objects
847+
*
848+
* @params response Response returned by the server for a request to updateLoginOrgConfigsMaxSessionDuration
849+
* @throws ApiException if the response code was not in [200, 299]
850+
*/
851+
public async updateLoginOrgConfigsMaxSessionDuration(
852+
response: ResponseContext
853+
): Promise<void> {
854+
const contentType = ObjectSerializer.normalizeMediaType(
855+
response.headers["content-type"]
856+
);
857+
if (response.httpStatusCode === 204) {
858+
return;
859+
}
860+
if (
861+
response.httpStatusCode === 400 ||
862+
response.httpStatusCode === 401 ||
863+
response.httpStatusCode === 403 ||
864+
response.httpStatusCode === 429
865+
) {
866+
const bodyText = ObjectSerializer.parse(
867+
await response.body.text(),
868+
contentType
869+
);
870+
let body: APIErrorResponse;
871+
try {
872+
body = ObjectSerializer.deserialize(
873+
bodyText,
874+
"APIErrorResponse"
875+
) as APIErrorResponse;
876+
} catch (error) {
877+
logger.debug(`Got error deserializing error: ${error}`);
878+
throw new ApiException<APIErrorResponse>(
879+
response.httpStatusCode,
880+
bodyText
881+
);
882+
}
883+
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
884+
}
885+
886+
// Work around for missing responses in specification, e.g. for petstore.yaml
887+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
888+
return;
889+
}
890+
891+
const body = (await response.body.text()) || "";
892+
throw new ApiException<string>(
893+
response.httpStatusCode,
894+
'Unknown API Status Code!\nBody: "' + body + '"'
895+
);
896+
}
897+
798898
/**
799899
* Unwraps the actual response sent by the server from the response context and deserializes the response content
800900
* to the expected objects
@@ -1094,6 +1194,13 @@ export interface OrganizationsApiListOrgsRequest {
10941194
filterName?: string;
10951195
}
10961196

1197+
export interface OrganizationsApiUpdateLoginOrgConfigsMaxSessionDurationRequest {
1198+
/**
1199+
* @type MaxSessionDurationUpdateRequest
1200+
*/
1201+
body: MaxSessionDurationUpdateRequest;
1202+
}
1203+
10971204
export interface OrganizationsApiUpdateOrgConfigRequest {
10981205
/**
10991206
* The name of an Org Config.
@@ -1325,6 +1432,31 @@ export class OrganizationsApi {
13251432
});
13261433
}
13271434

1435+
/**
1436+
* Update the maximum session duration for the current organization.
1437+
* The duration is specified in seconds.
1438+
* @param param The request object
1439+
*/
1440+
public updateLoginOrgConfigsMaxSessionDuration(
1441+
param: OrganizationsApiUpdateLoginOrgConfigsMaxSessionDurationRequest,
1442+
options?: Configuration
1443+
): Promise<void> {
1444+
const requestContextPromise =
1445+
this.requestFactory.updateLoginOrgConfigsMaxSessionDuration(
1446+
param.body,
1447+
options
1448+
);
1449+
return requestContextPromise.then((requestContext) => {
1450+
return this.configuration.httpApi
1451+
.send(requestContext)
1452+
.then((responseContext) => {
1453+
return this.responseProcessor.updateLoginOrgConfigsMaxSessionDuration(
1454+
responseContext
1455+
);
1456+
});
1457+
});
1458+
}
1459+
13281460
/**
13291461
* Update the value of a specific Org Config.
13301462
* @param param The request object

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,6 +1061,7 @@ export {
10611061
OrganizationsApiGetSAMLConfigurationRequest,
10621062
OrganizationsApiListGlobalOrgsRequest,
10631063
OrganizationsApiListOrgsRequest,
1064+
OrganizationsApiUpdateLoginOrgConfigsMaxSessionDurationRequest,
10641065
OrganizationsApiUpdateOrgConfigRequest,
10651066
OrganizationsApiUpdateOrgSamlConfigurationsRequest,
10661067
OrganizationsApiUpdateSAMLConfigurationRequest,
@@ -5002,6 +5003,10 @@ export { ManagedOrgsRelationshipToOrg } from "./models/ManagedOrgsRelationshipTo
50025003
export { ManagedOrgsRelationshipToOrgs } from "./models/ManagedOrgsRelationshipToOrgs";
50035004
export { ManagedOrgsResponse } from "./models/ManagedOrgsResponse";
50045005
export { ManagedOrgsType } from "./models/ManagedOrgsType";
5006+
export { MaxSessionDurationType } from "./models/MaxSessionDurationType";
5007+
export { MaxSessionDurationUpdateAttributes } from "./models/MaxSessionDurationUpdateAttributes";
5008+
export { MaxSessionDurationUpdateData } from "./models/MaxSessionDurationUpdateData";
5009+
export { MaxSessionDurationUpdateRequest } from "./models/MaxSessionDurationUpdateRequest";
50055010
export { McpScanRequest } from "./models/McpScanRequest";
50065011
export { McpScanRequestData } from "./models/McpScanRequestData";
50075012
export { McpScanRequestDataAttributes } from "./models/McpScanRequestDataAttributes";
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
* Data type of a maximum session duration update.
11+
*/
12+
13+
export type MaxSessionDurationType =
14+
| typeof MAX_SESSION_DURATION
15+
| UnparsedObject;
16+
export const MAX_SESSION_DURATION = "max_session_duration";

0 commit comments

Comments
 (0)