Skip to content

docs(clients): generate examples of making request with bare-bones clients #2347

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 3 commits into from
May 5, 2021
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 @@ -23,6 +23,20 @@ export interface ApplyArchiveRuleCommandOutput extends __MetadataBearer {}
/**
* <p>Retroactively applies the archive rule to existing findings that meet the archive rule
* criteria.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, ApplyArchiveRuleCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, ApplyArchiveRuleCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new ApplyArchiveRuleCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ApplyArchiveRuleCommandInput} for command's `input` shape.
* @see {@link ApplyArchiveRuleCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class ApplyArchiveRuleCommand extends $Command<
ApplyArchiveRuleCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ export interface CancelPolicyGenerationCommandOutput extends CancelPolicyGenerat

/**
* <p>Cancels the requested policy generation.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, CancelPolicyGenerationCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, CancelPolicyGenerationCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new CancelPolicyGenerationCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link CancelPolicyGenerationCommandInput} for command's `input` shape.
* @see {@link CancelPolicyGenerationCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class CancelPolicyGenerationCommand extends $Command<
CancelPolicyGenerationCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ export interface CreateAccessPreviewCommandOutput extends CreateAccessPreviewRes
/**
* <p>Creates an access preview that allows you to preview Access Analyzer findings for your resource
* before deploying resource permissions.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, CreateAccessPreviewCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, CreateAccessPreviewCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new CreateAccessPreviewCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link CreateAccessPreviewCommandInput} for command's `input` shape.
* @see {@link CreateAccessPreviewCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class CreateAccessPreviewCommand extends $Command<
CreateAccessPreviewCommandInput,
Expand Down
14 changes: 14 additions & 0 deletions clients/client-accessanalyzer/commands/CreateAnalyzerCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ export interface CreateAnalyzerCommandOutput extends CreateAnalyzerResponse, __M

/**
* <p>Creates an analyzer for your account.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, CreateAnalyzerCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, CreateAnalyzerCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new CreateAnalyzerCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link CreateAnalyzerCommandInput} for command's `input` shape.
* @see {@link CreateAnalyzerCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class CreateAnalyzerCommand extends $Command<
CreateAnalyzerCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ export interface CreateArchiveRuleCommandOutput extends __MetadataBearer {}
* new findings that meet the criteria you define when you create the rule.</p>
* <p>To learn about filter keys that you can use to create an archive rule, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html">Access Analyzer filter keys</a> in the <b>IAM User
* Guide</b>.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, CreateArchiveRuleCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, CreateArchiveRuleCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new CreateArchiveRuleCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link CreateArchiveRuleCommandInput} for command's `input` shape.
* @see {@link CreateArchiveRuleCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class CreateArchiveRuleCommand extends $Command<
CreateArchiveRuleCommandInput,
Expand Down
14 changes: 14 additions & 0 deletions clients/client-accessanalyzer/commands/DeleteAnalyzerCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ export interface DeleteAnalyzerCommandOutput extends __MetadataBearer {}
* <p>Deletes the specified analyzer. When you delete an analyzer, Access Analyzer is disabled for the
* account or organization in the current or specific Region. All findings that were generated
* by the analyzer are deleted. You cannot undo this action.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, DeleteAnalyzerCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, DeleteAnalyzerCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new DeleteAnalyzerCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link DeleteAnalyzerCommandInput} for command's `input` shape.
* @see {@link DeleteAnalyzerCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class DeleteAnalyzerCommand extends $Command<
DeleteAnalyzerCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ export interface DeleteArchiveRuleCommandOutput extends __MetadataBearer {}

/**
* <p>Deletes the specified archive rule.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, DeleteArchiveRuleCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, DeleteArchiveRuleCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new DeleteArchiveRuleCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link DeleteArchiveRuleCommandInput} for command's `input` shape.
* @see {@link DeleteArchiveRuleCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class DeleteArchiveRuleCommand extends $Command<
DeleteArchiveRuleCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ export interface GetAccessPreviewCommandOutput extends GetAccessPreviewResponse,

/**
* <p>Retrieves information about an access preview for the specified analyzer.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, GetAccessPreviewCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, GetAccessPreviewCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new GetAccessPreviewCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link GetAccessPreviewCommandInput} for command's `input` shape.
* @see {@link GetAccessPreviewCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class GetAccessPreviewCommand extends $Command<
GetAccessPreviewCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ export interface GetAnalyzedResourceCommandOutput extends GetAnalyzedResourceRes

/**
* <p>Retrieves information about a resource that was analyzed.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, GetAnalyzedResourceCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, GetAnalyzedResourceCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new GetAnalyzedResourceCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link GetAnalyzedResourceCommandInput} for command's `input` shape.
* @see {@link GetAnalyzedResourceCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class GetAnalyzedResourceCommand extends $Command<
GetAnalyzedResourceCommandInput,
Expand Down
14 changes: 14 additions & 0 deletions clients/client-accessanalyzer/commands/GetAnalyzerCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ export interface GetAnalyzerCommandOutput extends GetAnalyzerResponse, __Metadat

/**
* <p>Retrieves information about the specified analyzer.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, GetAnalyzerCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, GetAnalyzerCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new GetAnalyzerCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link GetAnalyzerCommandInput} for command's `input` shape.
* @see {@link GetAnalyzerCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class GetAnalyzerCommand extends $Command<
GetAnalyzerCommandInput,
Expand Down
14 changes: 14 additions & 0 deletions clients/client-accessanalyzer/commands/GetArchiveRuleCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ export interface GetArchiveRuleCommandOutput extends GetArchiveRuleResponse, __M
* <p>Retrieves information about an archive rule.</p>
* <p>To learn about filter keys that you can use to create an archive rule, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-reference-filter-keys.html">Access Analyzer filter keys</a> in the <b>IAM User
* Guide</b>.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, GetArchiveRuleCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, GetArchiveRuleCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new GetArchiveRuleCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link GetArchiveRuleCommandInput} for command's `input` shape.
* @see {@link GetArchiveRuleCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class GetArchiveRuleCommand extends $Command<
GetArchiveRuleCommandInput,
Expand Down
14 changes: 14 additions & 0 deletions clients/client-accessanalyzer/commands/GetFindingCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ export interface GetFindingCommandOutput extends GetFindingResponse, __MetadataB

/**
* <p>Retrieves information about the specified finding.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, GetFindingCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, GetFindingCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new GetFindingCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link GetFindingCommandInput} for command's `input` shape.
* @see {@link GetFindingCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class GetFindingCommand extends $Command<
GetFindingCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ export interface GetGeneratedPolicyCommandOutput extends GetGeneratedPolicyRespo
/**
* <p>Retrieves the policy that was generated using <code>StartPolicyGeneration</code>.
* </p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, GetGeneratedPolicyCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, GetGeneratedPolicyCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new GetGeneratedPolicyCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link GetGeneratedPolicyCommandInput} for command's `input` shape.
* @see {@link GetGeneratedPolicyCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class GetGeneratedPolicyCommand extends $Command<
GetGeneratedPolicyCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ export interface ListAccessPreviewFindingsCommandOutput extends ListAccessPrevie
/**
* <p>Retrieves a list of access preview findings generated by the specified access
* preview.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, ListAccessPreviewFindingsCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, ListAccessPreviewFindingsCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new ListAccessPreviewFindingsCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ListAccessPreviewFindingsCommandInput} for command's `input` shape.
* @see {@link ListAccessPreviewFindingsCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class ListAccessPreviewFindingsCommand extends $Command<
ListAccessPreviewFindingsCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ export interface ListAccessPreviewsCommandOutput extends ListAccessPreviewsRespo

/**
* <p>Retrieves a list of access previews for the specified analyzer.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, ListAccessPreviewsCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, ListAccessPreviewsCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new ListAccessPreviewsCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ListAccessPreviewsCommandInput} for command's `input` shape.
* @see {@link ListAccessPreviewsCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class ListAccessPreviewsCommand extends $Command<
ListAccessPreviewsCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ export interface ListAnalyzedResourcesCommandOutput extends ListAnalyzedResource
/**
* <p>Retrieves a list of resources of the specified type that have been analyzed by the
* specified analyzer..</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, ListAnalyzedResourcesCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, ListAnalyzedResourcesCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new ListAnalyzedResourcesCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ListAnalyzedResourcesCommandInput} for command's `input` shape.
* @see {@link ListAnalyzedResourcesCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class ListAnalyzedResourcesCommand extends $Command<
ListAnalyzedResourcesCommandInput,
Expand Down
14 changes: 14 additions & 0 deletions clients/client-accessanalyzer/commands/ListAnalyzersCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ export interface ListAnalyzersCommandOutput extends ListAnalyzersResponse, __Met

/**
* <p>Retrieves a list of analyzers.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, ListAnalyzersCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, ListAnalyzersCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new ListAnalyzersCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ListAnalyzersCommandInput} for command's `input` shape.
* @see {@link ListAnalyzersCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class ListAnalyzersCommand extends $Command<
ListAnalyzersCommandInput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ export interface ListArchiveRulesCommandOutput extends ListArchiveRulesResponse,

/**
* <p>Retrieves a list of archive rules created for the specified analyzer.</p>
* @example
* User a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AccessAnalyzerClient, ListArchiveRulesCommand } from "@aws-sdk/client-accessanalyzer"; // ES Modules import
* // const { AccessAnalyzerClient, ListArchiveRulesCommand } = require("@aws-sdk/client-accessanalyzer"); // CommonJS import
* const client = new AccessAnalyzerClient(config);
* const command = new ListArchiveRulesCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ListArchiveRulesCommandInput} for command's `input` shape.
* @see {@link ListArchiveRulesCommandOutput} for command's `response` shape.
* @see {@link AccessAnalyzerClientResolvedConfig | config} for command's `input` shape.
*
*/
export class ListArchiveRulesCommand extends $Command<
ListArchiveRulesCommandInput,
Expand Down
Loading