-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-grafana): This release adds APIs for creating and deletin…
…g API keys in an Amazon Managed Grafana workspace.
- Loading branch information
awstools
committed
May 13, 2022
1 parent
35d9f84
commit 091f6df
Showing
8 changed files
with
1,151 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
clients/client-grafana/src/commands/CreateWorkspaceApiKeyCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// smithy-typescript generated code | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { GrafanaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GrafanaClient"; | ||
import { CreateWorkspaceApiKeyRequest, CreateWorkspaceApiKeyResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1CreateWorkspaceApiKeyCommand, | ||
serializeAws_restJson1CreateWorkspaceApiKeyCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface CreateWorkspaceApiKeyCommandInput extends CreateWorkspaceApiKeyRequest {} | ||
export interface CreateWorkspaceApiKeyCommandOutput extends CreateWorkspaceApiKeyResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Creates an API key for the workspace. This key can be used to authenticate | ||
* requests sent to the workspace's HTTP API. See | ||
* <a href=" https://docs.aws.amazon.com/grafana/latest/userguide/Using-Grafana-APIs.html"> https://docs.aws.amazon.com/grafana/latest/userguide/Using-Grafana-APIs.html</a> | ||
* for available APIs and example requests.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { GrafanaClient, CreateWorkspaceApiKeyCommand } from "@aws-sdk/client-grafana"; // ES Modules import | ||
* // const { GrafanaClient, CreateWorkspaceApiKeyCommand } = require("@aws-sdk/client-grafana"); // CommonJS import | ||
* const client = new GrafanaClient(config); | ||
* const command = new CreateWorkspaceApiKeyCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link CreateWorkspaceApiKeyCommandInput} for command's `input` shape. | ||
* @see {@link CreateWorkspaceApiKeyCommandOutput} for command's `response` shape. | ||
* @see {@link GrafanaClientResolvedConfig | config} for GrafanaClient's `config` shape. | ||
* | ||
*/ | ||
export class CreateWorkspaceApiKeyCommand extends $Command< | ||
CreateWorkspaceApiKeyCommandInput, | ||
CreateWorkspaceApiKeyCommandOutput, | ||
GrafanaClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: CreateWorkspaceApiKeyCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: GrafanaClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<CreateWorkspaceApiKeyCommandInput, CreateWorkspaceApiKeyCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "GrafanaClient"; | ||
const commandName = "CreateWorkspaceApiKeyCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: CreateWorkspaceApiKeyRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: CreateWorkspaceApiKeyResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: CreateWorkspaceApiKeyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1CreateWorkspaceApiKeyCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateWorkspaceApiKeyCommandOutput> { | ||
return deserializeAws_restJson1CreateWorkspaceApiKeyCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
96 changes: 96 additions & 0 deletions
96
clients/client-grafana/src/commands/DeleteWorkspaceApiKeyCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
// smithy-typescript generated code | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { GrafanaClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../GrafanaClient"; | ||
import { DeleteWorkspaceApiKeyRequest, DeleteWorkspaceApiKeyResponse } from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1DeleteWorkspaceApiKeyCommand, | ||
serializeAws_restJson1DeleteWorkspaceApiKeyCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface DeleteWorkspaceApiKeyCommandInput extends DeleteWorkspaceApiKeyRequest {} | ||
export interface DeleteWorkspaceApiKeyCommandOutput extends DeleteWorkspaceApiKeyResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Deletes an API key for a workspace.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { GrafanaClient, DeleteWorkspaceApiKeyCommand } from "@aws-sdk/client-grafana"; // ES Modules import | ||
* // const { GrafanaClient, DeleteWorkspaceApiKeyCommand } = require("@aws-sdk/client-grafana"); // CommonJS import | ||
* const client = new GrafanaClient(config); | ||
* const command = new DeleteWorkspaceApiKeyCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link DeleteWorkspaceApiKeyCommandInput} for command's `input` shape. | ||
* @see {@link DeleteWorkspaceApiKeyCommandOutput} for command's `response` shape. | ||
* @see {@link GrafanaClientResolvedConfig | config} for GrafanaClient's `config` shape. | ||
* | ||
*/ | ||
export class DeleteWorkspaceApiKeyCommand extends $Command< | ||
DeleteWorkspaceApiKeyCommandInput, | ||
DeleteWorkspaceApiKeyCommandOutput, | ||
GrafanaClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: DeleteWorkspaceApiKeyCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: GrafanaClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<DeleteWorkspaceApiKeyCommandInput, DeleteWorkspaceApiKeyCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "GrafanaClient"; | ||
const commandName = "DeleteWorkspaceApiKeyCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: DeleteWorkspaceApiKeyRequest.filterSensitiveLog, | ||
outputFilterSensitiveLog: DeleteWorkspaceApiKeyResponse.filterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: DeleteWorkspaceApiKeyCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1DeleteWorkspaceApiKeyCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DeleteWorkspaceApiKeyCommandOutput> { | ||
return deserializeAws_restJson1DeleteWorkspaceApiKeyCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.