Skip to content

Commit

Permalink
feat(client-inspector2): This release adds CSV format to GetCisScanRe…
Browse files Browse the repository at this point in the history
…port for Inspector v2
  • Loading branch information
awstools committed May 3, 2024
1 parent 9dac593 commit 79fb03b
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface GetCisScanReportCommandOutput extends GetCisScanReportResponse,
* targetAccounts: [ // ReportTargetAccounts
* "STRING_VALUE",
* ],
* reportFormat: "PDF" || "CSV",
* };
* const command = new GetCisScanReportCommand(input);
* const response = await client.send(command);
Expand All @@ -61,6 +62,9 @@ export interface GetCisScanReportCommandOutput extends GetCisScanReportResponse,
* @throws {@link InternalServerException} (server fault)
* <p>The request has failed due to an internal failure of the Amazon Inspector service.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>The operation tried to access an invalid resource. Make sure the resource is specified correctly.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>The limit on the number of requests per second was exceeded.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { commonParams } from "../endpoint/EndpointParameters";
import { Inspector2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../Inspector2Client";
import { ListCisScanResultsAggregatedByTargetResourceRequest } from "../models/models_0";
import { ListCisScanResultsAggregatedByTargetResourceResponse } from "../models/models_1";
import {
ListCisScanResultsAggregatedByTargetResourceRequest,
ListCisScanResultsAggregatedByTargetResourceResponse,
} from "../models/models_1";
import {
de_ListCisScanResultsAggregatedByTargetResourceCommand,
se_ListCisScanResultsAggregatedByTargetResourceCommand,
Expand Down
67 changes: 25 additions & 42 deletions clients/client-inspector2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3328,6 +3328,20 @@ export interface CisNumberFilter {
lowerInclusive?: number;
}

/**
* @public
* @enum
*/
export const CisReportFormat = {
CSV: "CSV",
PDF: "PDF",
} as const;

/**
* @public
*/
export type CisReportFormat = (typeof CisReportFormat)[keyof typeof CisReportFormat];

/**
* @public
* @enum
Expand Down Expand Up @@ -7144,6 +7158,16 @@ export interface GetCisScanReportRequest {
* @public
*/
targetAccounts?: string[];

/**
* <p>
* The format of the report.
* Valid values are <code>PDF</code> and <code>CSV</code>.
* If no value is specified, the report format defaults to <code>PDF</code>.
* </p>
* @public
*/
reportFormat?: CisReportFormat;
}

/**
Expand All @@ -7152,7 +7176,7 @@ export interface GetCisScanReportRequest {
export interface GetCisScanReportResponse {
/**
* <p>
* The URL where a PDF of the CIS scan report can be downloaded.
* The URL where a PDF or CSV of the CIS scan report can be downloaded.
* </p>
* @public
*/
Expand Down Expand Up @@ -7740,44 +7764,3 @@ export interface ListCisScanResultsAggregatedByChecksResponse {
*/
nextToken?: string;
}

/**
* @public
*/
export interface ListCisScanResultsAggregatedByTargetResourceRequest {
/**
* <p>The scan ARN.</p>
* @public
*/
scanArn: string | undefined;

/**
* <p>The filter criteria.</p>
* @public
*/
filterCriteria?: CisScanResultsAggregatedByTargetResourceFilterCriteria;

/**
* <p>The sort by order.</p>
* @public
*/
sortBy?: CisScanResultsAggregatedByTargetResourceSortBy;

/**
* <p>The sort order.</p>
* @public
*/
sortOrder?: CisSortOrder;

/**
* <p>The pagination token from a previous request that's used to retrieve the next page of results.</p>
* @public
*/
nextToken?: string;

/**
* <p>The maximum number of scan results aggregated by a target resource to be returned in a single page of results.</p>
* @public
*/
maxResults?: number;
}
43 changes: 43 additions & 0 deletions clients/client-inspector2/src/models/models_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import {
CisDateFilter,
CisNumberFilter,
CisScan,
CisScanResultsAggregatedByTargetResourceFilterCriteria,
CisScanResultsAggregatedByTargetResourceSortBy,
CisScanStatusFilter,
CisSecurityLevel,
CisSessionMessage,
Expand Down Expand Up @@ -42,6 +44,47 @@ import {
TagFilter,
} from "./models_0";

/**
* @public
*/
export interface ListCisScanResultsAggregatedByTargetResourceRequest {
/**
* <p>The scan ARN.</p>
* @public
*/
scanArn: string | undefined;

/**
* <p>The filter criteria.</p>
* @public
*/
filterCriteria?: CisScanResultsAggregatedByTargetResourceFilterCriteria;

/**
* <p>The sort by order.</p>
* @public
*/
sortBy?: CisScanResultsAggregatedByTargetResourceSortBy;

/**
* <p>The sort order.</p>
* @public
*/
sortOrder?: CisSortOrder;

/**
* <p>The pagination token from a previous request that's used to retrieve the next page of results.</p>
* @public
*/
nextToken?: string;

/**
* <p>The maximum number of scan results aggregated by a target resource to be returned in a single page of results.</p>
* @public
*/
maxResults?: number;
}

/**
* @public
*/
Expand Down
1 change: 1 addition & 0 deletions clients/client-inspector2/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ export const se_GetCisScanReportCommand = async (
let body: any;
body = JSON.stringify(
take(input, {
reportFormat: [],
scanArn: [],
targetAccounts: (_) => _json(_),
})
Expand Down
32 changes: 30 additions & 2 deletions codegen/sdk-codegen/aws-models/inspector2.json
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,23 @@
"smithy.api#pattern": "^\\d{12}|o-[a-z0-9]{10,32}$"
}
},
"com.amazonaws.inspector2#CisReportFormat": {
"type": "enum",
"members": {
"PDF": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "PDF"
}
},
"CSV": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "CSV"
}
}
}
},
"com.amazonaws.inspector2#CisReportStatus": {
"type": "enum",
"members": {
Expand Down Expand Up @@ -6967,6 +6984,9 @@
{
"target": "com.amazonaws.inspector2#InternalServerException"
},
{
"target": "com.amazonaws.inspector2#ResourceNotFoundException"
},
{
"target": "com.amazonaws.inspector2#ThrottlingException"
},
Expand All @@ -6980,7 +7000,8 @@
{
"title": "Sample GetCisScanReport Call",
"input": {
"scanArn": "arn:aws:inspector2:us-east-1:123412341234:owner/123412341234/cis-scan/624b746d-e080-44ae-8c1d-48e653365a38"
"scanArn": "arn:aws:inspector2:us-east-1:123412341234:owner/123412341234/cis-scan/624b746d-e080-44ae-8c1d-48e653365a38",
"reportFormat": "PDF"
},
"output": {
"url": "www.s3.amazon.com/abcdef",
Expand Down Expand Up @@ -7010,6 +7031,13 @@
"traits": {
"smithy.api#documentation": "<p>The target accounts.</p>"
}
},
"reportFormat": {
"target": "com.amazonaws.inspector2#CisReportFormat",
"traits": {
"smithy.api#default": "PDF",
"smithy.api#documentation": "<p>\n The format of the report. \n Valid values are <code>PDF</code> and <code>CSV</code>. \n If no value is specified, the report format defaults to <code>PDF</code>.\n </p>"
}
}
},
"traits": {
Expand All @@ -7022,7 +7050,7 @@
"url": {
"target": "smithy.api#String",
"traits": {
"smithy.api#documentation": "<p>\n The URL where a PDF of the CIS scan report can be downloaded.\n </p>"
"smithy.api#documentation": "<p>\n The URL where a PDF or CSV of the CIS scan report can be downloaded.\n </p>"
}
},
"status": {
Expand Down

0 comments on commit 79fb03b

Please sign in to comment.