Skip to content

Commit aa27003

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit de2517a of spec repo (#2450)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 0dfc312 commit aa27003

11 files changed

+371
-0
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,6 +1556,54 @@ components:
15561556
- type
15571557
- credentials
15581558
type: object
1559+
AWSIntegrationIamPermissionsResponse:
1560+
description: AWS Integration IAM Permissions response body.
1561+
properties:
1562+
data:
1563+
$ref: '#/components/schemas/AWSIntegrationIamPermissionsResponseData'
1564+
required:
1565+
- data
1566+
type: object
1567+
AWSIntegrationIamPermissionsResponseAttributes:
1568+
description: AWS Integration IAM Permissions response attributes.
1569+
properties:
1570+
permissions:
1571+
description: List of AWS IAM permissions required for the integration.
1572+
example:
1573+
- account:GetContactInformation
1574+
- amplify:ListApps
1575+
- amplify:ListArtifacts
1576+
- amplify:ListBackendEnvironments
1577+
- amplify:ListBranches
1578+
items:
1579+
example: account:GetContactInformation
1580+
type: string
1581+
type: array
1582+
required:
1583+
- permissions
1584+
type: object
1585+
AWSIntegrationIamPermissionsResponseData:
1586+
description: AWS Integration IAM Permissions response data.
1587+
properties:
1588+
attributes:
1589+
$ref: '#/components/schemas/AWSIntegrationIamPermissionsResponseAttributes'
1590+
id:
1591+
default: permissions
1592+
description: The `AWSIntegrationIamPermissionsResponseData` `id`.
1593+
example: permissions
1594+
type: string
1595+
type:
1596+
$ref: '#/components/schemas/AWSIntegrationIamPermissionsResponseDataType'
1597+
type: object
1598+
AWSIntegrationIamPermissionsResponseDataType:
1599+
default: permissions
1600+
description: The `AWSIntegrationIamPermissionsResponseData` `type`.
1601+
enum:
1602+
- permissions
1603+
example: permissions
1604+
type: string
1605+
x-enum-varnames:
1606+
- PERMISSIONS
15591607
AWSIntegrationType:
15601608
description: The definition of `AWSIntegrationType` object.
15611609
enum:
@@ -50708,6 +50756,25 @@ paths:
5070850756
x-unstable: '**Note: This endpoint is in Preview. If you have any feedback,
5070950757

5071050758
contact [Datadog support](https://docs.datadoghq.com/help/).**'
50759+
/api/v2/integration/aws/iam_permissions:
50760+
get:
50761+
description: Get all AWS IAM permissions required for the AWS integration.
50762+
operationId: GetAWSIntegrationIAMPermissions
50763+
responses:
50764+
'200':
50765+
content:
50766+
application/json:
50767+
schema:
50768+
$ref: '#/components/schemas/AWSIntegrationIamPermissionsResponse'
50769+
description: AWS IAM Permissions object
50770+
'429':
50771+
$ref: '#/components/responses/TooManyRequestsResponse'
50772+
summary: Get AWS integration IAM permissions
50773+
tags:
50774+
- AWS Integration
50775+
x-menu-order: 6
50776+
x-undo:
50777+
type: safe
5071150778
/api/v2/integration/aws/logs/services:
5071250779
get:
5071350780
description: Get a list of AWS services that can send logs to Datadog.

features/v2/aws_integration.feature

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ Feature: AWS Integration
8282
When the request is sent
8383
Then the response status is 200 AWS External ID object
8484

85+
@generated @skip @team:DataDog/aws-integrations
86+
Scenario: Get AWS integration IAM permissions returns "AWS IAM Permissions object" response
87+
Given new "GetAWSIntegrationIAMPermissions" request
88+
When the request is sent
89+
Then the response status is 200 AWS IAM Permissions object
90+
8591
@team:DataDog/aws-integrations
8692
Scenario: Get an AWS integration by config ID returns "AWS Account object" response
8793
Given operation "GetAWSAccount" enabled

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,6 +1214,12 @@
12141214
"type": "safe"
12151215
}
12161216
},
1217+
"GetAWSIntegrationIAMPermissions": {
1218+
"tag": "AWS Integration",
1219+
"undo": {
1220+
"type": "safe"
1221+
}
1222+
},
12171223
"ListAWSLogsServices": {
12181224
"tag": "AWS Logs Integration",
12191225
"undo": {

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5035,6 +5035,9 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
50355035
"AWSIntegrationApi.V2.CreateNewAWSExternalID": {
50365036
operationResponseType: "AWSNewExternalIDResponse",
50375037
},
5038+
"AWSIntegrationApi.V2.GetAWSIntegrationIAMPermissions": {
5039+
operationResponseType: "AWSIntegrationIamPermissionsResponse",
5040+
},
50385041
"AWSLogsIntegrationApi.V2.ListAWSLogsServices": {
50395042
operationResponseType: "AWSLogsServicesResponse",
50405043
},

services/aws_integration/src/v2/AWSIntegrationApi.ts

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { AWSAccountCreateRequest } from "./models/AWSAccountCreateRequest";
2727
import { AWSAccountResponse } from "./models/AWSAccountResponse";
2828
import { AWSAccountsResponse } from "./models/AWSAccountsResponse";
2929
import { AWSAccountUpdateRequest } from "./models/AWSAccountUpdateRequest";
30+
import { AWSIntegrationIamPermissionsResponse } from "./models/AWSIntegrationIamPermissionsResponse";
3031
import { AWSNamespacesResponse } from "./models/AWSNamespacesResponse";
3132
import { AWSNewExternalIDResponse } from "./models/AWSNewExternalIDResponse";
3233
import { version } from "../version";
@@ -241,6 +242,41 @@ export class AWSIntegrationApiRequestFactory extends BaseAPIRequestFactory {
241242
return requestContext;
242243
}
243244

245+
public async getAWSIntegrationIAMPermissions(
246+
_options?: Configuration,
247+
): Promise<RequestContext> {
248+
const _config = _options || this.configuration;
249+
250+
// Path Params
251+
const localVarPath = "/api/v2/integration/aws/iam_permissions";
252+
253+
// Make Request Context
254+
const { server, overrides } = _config.getServerAndOverrides(
255+
"AWSIntegrationApi.v2.getAWSIntegrationIAMPermissions",
256+
AWSIntegrationApi.operationServers,
257+
);
258+
const requestContext = server.makeRequestContext(
259+
localVarPath,
260+
HttpMethod.GET,
261+
overrides,
262+
);
263+
requestContext.setHeaderParam("Accept", "application/json");
264+
requestContext.setHttpConfig(_config.httpConfig);
265+
266+
// Set User-Agent
267+
if (this.userAgent) {
268+
requestContext.setHeaderParam("User-Agent", this.userAgent);
269+
}
270+
271+
// Apply auth methods
272+
applySecurityAuthentication(_config, requestContext, [
273+
"apiKeyAuth",
274+
"appKeyAuth",
275+
]);
276+
277+
return requestContext;
278+
}
279+
244280
public async listAWSAccounts(
245281
awsAccountId?: string,
246282
_options?: Configuration,
@@ -627,6 +663,62 @@ export class AWSIntegrationApiResponseProcessor {
627663
);
628664
}
629665

666+
/**
667+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
668+
* to the expected objects
669+
*
670+
* @params response Response returned by the server for a request to getAWSIntegrationIAMPermissions
671+
* @throws ApiException if the response code was not in [200, 299]
672+
*/
673+
public async getAWSIntegrationIAMPermissions(
674+
response: ResponseContext,
675+
): Promise<AWSIntegrationIamPermissionsResponse> {
676+
const contentType = normalizeMediaType(response.headers["content-type"]);
677+
if (response.httpStatusCode === 200) {
678+
const body: AWSIntegrationIamPermissionsResponse = deserialize(
679+
parse(await response.body.text(), contentType),
680+
TypingInfo,
681+
"AWSIntegrationIamPermissionsResponse",
682+
) as AWSIntegrationIamPermissionsResponse;
683+
return body;
684+
}
685+
if (response.httpStatusCode === 429) {
686+
const bodyText = parse(await response.body.text(), contentType);
687+
let body: APIErrorResponse;
688+
try {
689+
body = deserialize(
690+
bodyText,
691+
TypingInfo,
692+
"APIErrorResponse",
693+
) as APIErrorResponse;
694+
} catch (error) {
695+
logger.debug(`Got error deserializing error: ${error}`);
696+
throw new ApiException<APIErrorResponse>(
697+
response.httpStatusCode,
698+
bodyText,
699+
);
700+
}
701+
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
702+
}
703+
704+
// Work around for missing responses in specification, e.g. for petstore.yaml
705+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
706+
const body: AWSIntegrationIamPermissionsResponse = deserialize(
707+
parse(await response.body.text(), contentType),
708+
TypingInfo,
709+
"AWSIntegrationIamPermissionsResponse",
710+
"",
711+
) as AWSIntegrationIamPermissionsResponse;
712+
return body;
713+
}
714+
715+
const body = (await response.body.text()) || "";
716+
throw new ApiException<string>(
717+
response.httpStatusCode,
718+
'Unknown API Status Code!\nBody: "' + body + '"',
719+
);
720+
}
721+
630722
/**
631723
* Unwraps the actual response sent by the server from the response context and deserializes the response content
632724
* to the expected objects
@@ -947,6 +1039,26 @@ export class AWSIntegrationApi {
9471039
});
9481040
}
9491041

1042+
/**
1043+
* Get all AWS IAM permissions required for the AWS integration.
1044+
* @param param The request object
1045+
*/
1046+
public getAWSIntegrationIAMPermissions(
1047+
options?: Configuration,
1048+
): Promise<AWSIntegrationIamPermissionsResponse> {
1049+
const requestContextPromise =
1050+
this.requestFactory.getAWSIntegrationIAMPermissions(options);
1051+
return requestContextPromise.then((requestContext) => {
1052+
return this.configuration.httpApi
1053+
.send(requestContext)
1054+
.then((responseContext) => {
1055+
return this.responseProcessor.getAWSIntegrationIAMPermissions(
1056+
responseContext,
1057+
);
1058+
});
1059+
});
1060+
}
1061+
9501062
/**
9511063
* Get a list of AWS Account Integration Configs.
9521064
* @param param The request object

services/aws_integration/src/v2/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ export { AWSAccountUpdateRequestData } from "./models/AWSAccountUpdateRequestDat
2323
export { AWSAuthConfig } from "./models/AWSAuthConfig";
2424
export { AWSAuthConfigKeys } from "./models/AWSAuthConfigKeys";
2525
export { AWSAuthConfigRole } from "./models/AWSAuthConfigRole";
26+
export { AWSIntegrationIamPermissionsResponse } from "./models/AWSIntegrationIamPermissionsResponse";
27+
export { AWSIntegrationIamPermissionsResponseAttributes } from "./models/AWSIntegrationIamPermissionsResponseAttributes";
28+
export { AWSIntegrationIamPermissionsResponseData } from "./models/AWSIntegrationIamPermissionsResponseData";
29+
export { AWSIntegrationIamPermissionsResponseDataType } from "./models/AWSIntegrationIamPermissionsResponseDataType";
2630
export { AWSLambdaForwarderConfig } from "./models/AWSLambdaForwarderConfig";
2731
export { AWSLogsConfig } from "./models/AWSLogsConfig";
2832
export { AWSMetricsConfig } from "./models/AWSMetricsConfig";
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { AttributeTypeMap } from "@datadog/datadog-api-client";
2+
3+
import { AWSIntegrationIamPermissionsResponseData } from "./AWSIntegrationIamPermissionsResponseData";
4+
5+
/**
6+
* AWS Integration IAM Permissions response body.
7+
*/
8+
export class AWSIntegrationIamPermissionsResponse {
9+
/**
10+
* AWS Integration IAM Permissions response data.
11+
*/
12+
"data": AWSIntegrationIamPermissionsResponseData;
13+
/**
14+
* A container for additional, undeclared properties.
15+
* This is a holder for any undeclared properties as specified with
16+
* the 'additionalProperties' keyword in the OAS document.
17+
*/
18+
"additionalProperties"?: { [key: string]: any };
19+
/**
20+
* @ignore
21+
*/
22+
"_unparsed"?: boolean;
23+
24+
/**
25+
* @ignore
26+
*/
27+
static readonly attributeTypeMap: AttributeTypeMap = {
28+
data: {
29+
baseName: "data",
30+
type: "AWSIntegrationIamPermissionsResponseData",
31+
required: true,
32+
},
33+
additionalProperties: {
34+
baseName: "additionalProperties",
35+
type: "{ [key: string]: any; }",
36+
},
37+
};
38+
39+
/**
40+
* @ignore
41+
*/
42+
static getAttributeTypeMap(): AttributeTypeMap {
43+
return AWSIntegrationIamPermissionsResponse.attributeTypeMap;
44+
}
45+
46+
public constructor() {}
47+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { AttributeTypeMap } from "@datadog/datadog-api-client";
2+
3+
/**
4+
* AWS Integration IAM Permissions response attributes.
5+
*/
6+
export class AWSIntegrationIamPermissionsResponseAttributes {
7+
/**
8+
* List of AWS IAM permissions required for the integration.
9+
*/
10+
"permissions": Array<string>;
11+
/**
12+
* A container for additional, undeclared properties.
13+
* This is a holder for any undeclared properties as specified with
14+
* the 'additionalProperties' keyword in the OAS document.
15+
*/
16+
"additionalProperties"?: { [key: string]: any };
17+
/**
18+
* @ignore
19+
*/
20+
"_unparsed"?: boolean;
21+
22+
/**
23+
* @ignore
24+
*/
25+
static readonly attributeTypeMap: AttributeTypeMap = {
26+
permissions: {
27+
baseName: "permissions",
28+
type: "Array<string>",
29+
required: true,
30+
},
31+
additionalProperties: {
32+
baseName: "additionalProperties",
33+
type: "{ [key: string]: any; }",
34+
},
35+
};
36+
37+
/**
38+
* @ignore
39+
*/
40+
static getAttributeTypeMap(): AttributeTypeMap {
41+
return AWSIntegrationIamPermissionsResponseAttributes.attributeTypeMap;
42+
}
43+
44+
public constructor() {}
45+
}

0 commit comments

Comments
 (0)