Skip to content

docs(clients): switch example generation from JS to Smithy, add streaming blob output examples #6981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface ApplyArchiveRuleCommandOutput extends __MetadataBearer {}
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class ApplyArchiveRuleCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export interface CancelPolicyGenerationCommandOutput extends CancelPolicyGenerat
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class CancelPolicyGenerationCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,89 +96,87 @@ export interface CheckAccessNotGrantedCommandOutput extends CheckAccessNotGrante
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
* @public
*
* @example Passing check. Restrictive identity policy.
* ```javascript
* //
* const input = {
* "access": [
* access: [
* {
* "actions": [
* actions: [
* "s3:PutObject"
* ]
* }
* ],
* "policyDocument": "{\"Version\":\"2012-10-17\",\"Id\":\"123\",\"Statement\":[{\"Sid\":\"AllowJohnDoe\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:user/JohnDoe\"},\"Action\":\"s3:GetObject\",\"Resource\":\"*\"}]}",
* "policyType": "RESOURCE_POLICY"
* policyDocument: `{"Version":"2012-10-17","Id":"123","Statement":[{"Sid":"AllowJohnDoe","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::123456789012:user/JohnDoe"},"Action":"s3:GetObject","Resource":"*"}]}`,
* policyType: "RESOURCE_POLICY"
* };
* const command = new CheckAccessNotGrantedCommand(input);
* const response = await client.send(command);
* /* response ==
* /* response is
* {
* "message": "The policy document does not grant access to perform the listed actions or resources.",
* "result": "PASS"
* message: "The policy document does not grant access to perform the listed actions or resources.",
* result: "PASS"
* }
* *\/
* // example id: example-1
* ```
*
* @example Passing check. Restrictive S3 Bucket resource policy.
* ```javascript
* //
* const input = {
* "access": [
* access: [
* {
* "resources": [
* resources: [
* "arn:aws:s3:::sensitive-bucket/*"
* ]
* }
* ],
* "policyDocument": "{\"Version\":\"2012-10-17\",\"Id\":\"123\",\"Statement\":[{\"Sid\":\"AllowJohnDoe\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:user/JohnDoe\"},\"Action\":\"s3:PutObject\",\"Resource\":\"arn:aws:s3:::non-sensitive-bucket/*\"}]}",
* "policyType": "RESOURCE_POLICY"
* policyDocument: `{"Version":"2012-10-17","Id":"123","Statement":[{"Sid":"AllowJohnDoe","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::123456789012:user/JohnDoe"},"Action":"s3:PutObject","Resource":"arn:aws:s3:::non-sensitive-bucket/*"}]}`,
* policyType: "RESOURCE_POLICY"
* };
* const command = new CheckAccessNotGrantedCommand(input);
* const response = await client.send(command);
* /* response ==
* /* response is
* {
* "message": "The policy document does not grant access to perform the listed actions or resources.",
* "result": "PASS"
* message: "The policy document does not grant access to perform the listed actions or resources.",
* result: "PASS"
* }
* *\/
* // example id: example-2
* ```
*
* @example Failing check. Permissive S3 Bucket resource policy.
* ```javascript
* //
* const input = {
* "access": [
* access: [
* {
* "resources": [
* resources: [
* "arn:aws:s3:::my-bucket/*"
* ]
* }
* ],
* "policyDocument": "{\"Version\":\"2012-10-17\",\"Id\":\"123\",\"Statement\":[{\"Sid\":\"AllowJohnDoe\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::123456789012:user/JohnDoe\"},\"Action\":\"s3:PutObject\",\"Resource\":\"arn:aws:s3:::my-bucket/*\"}]}",
* "policyType": "RESOURCE_POLICY"
* policyDocument: `{"Version":"2012-10-17","Id":"123","Statement":[{"Sid":"AllowJohnDoe","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::123456789012:user/JohnDoe"},"Action":"s3:PutObject","Resource":"arn:aws:s3:::my-bucket/*"}]}`,
* policyType: "RESOURCE_POLICY"
* };
* const command = new CheckAccessNotGrantedCommand(input);
* const response = await client.send(command);
* /* response ==
* /* response is
* {
* "message": "The policy document grants access to perform one or more of the listed actions or resources.",
* "reasons": [
* message: "The policy document grants access to perform one or more of the listed actions or resources.",
* reasons: [
* {
* "description": "One or more of the listed actions or resources in the statement with sid: AllowJohnDoe.",
* "statementId": "AllowJohnDoe",
* "statementIndex": 0
* description: "One or more of the listed actions or resources in the statement with sid: AllowJohnDoe.",
* statementId: "AllowJohnDoe",
* statementIndex: 0
* }
* ],
* "result": "FAIL"
* result: "FAIL"
* }
* *\/
* // example id: example-3
* ```
*
* @public
*/
export class CheckAccessNotGrantedCommand extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export interface CheckNoNewAccessCommandOutput extends CheckNoNewAccessResponse,
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class CheckNoNewAccessCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,50 +87,49 @@ export interface CheckNoPublicAccessCommandOutput extends CheckNoPublicAccessRes
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
* @public
*
* @example Passing check. S3 Bucket policy without public access.
* ```javascript
* //
* const input = {
* "policyDocument": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Bob\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::111122223333:user/JohnDoe\"},\"Action\":[\"s3:GetObject\"]}]}",
* "resourceType": "AWS::S3::Bucket"
* policyDocument: `{"Version":"2012-10-17","Statement":[{"Sid":"Bob","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::111122223333:user/JohnDoe"},"Action":["s3:GetObject"]}]}`,
* resourceType: "AWS::S3::Bucket"
* };
* const command = new CheckNoPublicAccessCommand(input);
* const response = await client.send(command);
* /* response ==
* /* response is
* {
* "message": "The resource policy does not grant public access for the given resource type.",
* "result": "PASS"
* message: "The resource policy does not grant public access for the given resource type.",
* result: "PASS"
* }
* *\/
* // example id: example-1
* ```
*
* @example Failing check. S3 Bucket policy with public access.
* ```javascript
* //
* const input = {
* "policyDocument": "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"Bob\",\"Effect\":\"Allow\",\"Principal\":\"*\",\"Action\":[\"s3:GetObject\"]}]}",
* "resourceType": "AWS::S3::Bucket"
* policyDocument: `{"Version":"2012-10-17","Statement":[{"Sid":"Bob","Effect":"Allow","Principal":"*","Action":["s3:GetObject"]}]}`,
* resourceType: "AWS::S3::Bucket"
* };
* const command = new CheckNoPublicAccessCommand(input);
* const response = await client.send(command);
* /* response ==
* /* response is
* {
* "message": "The resource policy grants public access for the given resource type.",
* "reasons": [
* message: "The resource policy grants public access for the given resource type.",
* reasons: [
* {
* "description": "Public access granted in the following statement with sid: Bob.",
* "statementId": "Bob",
* "statementIndex": 0
* description: "Public access granted in the following statement with sid: Bob.",
* statementId: "Bob",
* statementIndex: 0
* }
* ],
* "result": "FAIL"
* result: "FAIL"
* }
* *\/
* // example id: example-2
* ```
*
* @public
*/
export class CheckNoPublicAccessCommand extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export interface CreateAccessPreviewCommandOutput extends CreateAccessPreviewRes
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class CreateAccessPreviewCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ export interface CreateAnalyzerCommandOutput extends CreateAnalyzerResponse, __M
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class CreateAnalyzerCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export interface CreateArchiveRuleCommandOutput extends __MetadataBearer {}
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class CreateArchiveRuleCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface DeleteAnalyzerCommandOutput extends __MetadataBearer {}
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class DeleteAnalyzerCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface DeleteArchiveRuleCommandOutput extends __MetadataBearer {}
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class DeleteArchiveRuleCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,36 @@ export interface GenerateFindingRecommendationCommandOutput extends __MetadataBe
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
* @public
*
* @example Successfully started generating finding recommendation
* ```javascript
* //
* const input = {
* "analyzerArn": "arn:aws:access-analyzer:us-east-1:111122223333:analyzer/a",
* "id": "finding-id"
* analyzerArn: "arn:aws:access-analyzer:us-east-1:111122223333:analyzer/a",
* id: "finding-id"
* };
* const command = new GenerateFindingRecommendationCommand(input);
* await client.send(command);
* // example id: example-1
* const response = await client.send(command);
* /* response is
* { /* empty *\/ }
* *\/
* ```
*
* @example Failed field validation for id value
* ```javascript
* //
* const input = {
* "analyzerArn": "arn:aws:access-analyzer:us-east-1:111122223333:analyzer/a",
* "id": "!"
* analyzerArn: "arn:aws:access-analyzer:us-east-1:111122223333:analyzer/a",
* id: "!"
* };
* const command = new GenerateFindingRecommendationCommand(input);
* await client.send(command);
* // example id: example-2
* const response = await client.send(command);
* /* response is
* { /* metadata only *\/ }
* *\/
* ```
*
* @public
*/
export class GenerateFindingRecommendationCommand extends $Command
.classBuilder<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export interface GetAccessPreviewCommandOutput extends GetAccessPreviewResponse,
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class GetAccessPreviewCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export interface GetAnalyzedResourceCommandOutput extends GetAnalyzedResourceRes
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class GetAnalyzedResourceCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export interface GetAnalyzerCommandOutput extends GetAnalyzerResponse, __Metadat
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class GetAnalyzerCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export interface GetArchiveRuleCommandOutput extends GetArchiveRuleResponse, __M
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class GetArchiveRuleCommand extends $Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export interface GetFindingCommandOutput extends GetFindingResponse, __MetadataB
* @throws {@link AccessAnalyzerServiceException}
* <p>Base exception class for all service exceptions from AccessAnalyzer service.</p>
*
*
* @public
*/
export class GetFindingCommand extends $Command
Expand Down
Loading
Loading