### Install Playwright Browsers Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/web.md Install the necessary Playwright browser binaries, which is often required when troubleshooting launch failures. ```bash npx playwright install ``` -------------------------------- ### StartTransformationCommand Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Starts a transformation process. This command is part of the QDeveloperStreaming service. ```APIDOC ## POST /StartTransformation ### Description Starts a transformation process. ### Method POST ### Endpoint /StartTransformation ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body Refer to the Input documentation for details on the request body structure. ### Request Example ```json { "example": "request body for StartTransformation" } ``` ### Response #### Success Response (200) Refer to the Output documentation for details on the success response structure. #### Response Example ```json { "example": "response body for StartTransformation" } ``` ``` -------------------------------- ### StartTaskAssistCodeGenerationCommand Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Starts code generation for task assistance. This command is part of the QDeveloperStreaming service. ```APIDOC ## POST /StartTaskAssistCodeGeneration ### Description Starts code generation for task assistance. ### Method POST ### Endpoint /StartTaskAssistCodeGeneration ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body Refer to the Input documentation for details on the request body structure. ### Request Example ```json { "example": "request body for StartTaskAssistCodeGeneration" } ``` ### Response #### Success Response (200) Refer to the Output documentation for details on the success response structure. #### Response Example ```json { "example": "response body for StartTaskAssistCodeGeneration" } ``` ``` -------------------------------- ### Clone Repository and Install NPM Packages Source: https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md Standard procedure to clone the AWS Toolkit for VS Code repository and install its dependencies using npm. ```bash git clone git@github.com:aws/aws-toolkit-vscode.git cd aws-toolkit-vscode npm install ``` -------------------------------- ### Test Setup for Quick Picks Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/CODE_GUIDELINES.md Set up a tester for QuickPickPrompter implementations. This involves creating a prompter with specific configurations and then initializing the tester with it. ```typescript const prompter = createRegionPrompter(regions, { title: 'Select region', buttons: createCommonButtons('https://aws.amazon.com/'), defaultRegion: 'foo-bar-1', }) const tester = createQuickPickTester(prompter) ``` -------------------------------- ### Example Metric Output Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/telemetry.md Illustrates the structure of a metric event emitted after a failure in `setupStep2`, including session ID, result, and reason. ```json { "metadata.metricName": "metric_setupThing", "sessionId": "123456", "result": "Failed", "reason": "SomethingWentWrongInStep2", ... } ``` -------------------------------- ### Recommend VSCode Extensions Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/vscode-config.md Example extensions.json to recommend the aws-toolkit-vscode extension and others based on project needs. ```json { "recommendations": ["amazonwebservices.aws-toolkit-vscode"] } ``` -------------------------------- ### StartTroubleshootingAnalysis Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Starts a troubleshooting analysis in the CodeWhisperer streaming service. ```APIDOC ## POST / StartTroubleshootingAnalysis ### Description Initiates an analysis to troubleshoot issues within the CodeWhisperer streaming service. ### Method POST ### Endpoint /StartTroubleshootingAnalysis ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **analysisId** (string) - Required - A unique identifier for this analysis request. - **problemDetails** (object) - Required - Details about the problem to be analyzed. - **description** (string) - Required - A textual description of the problem. - **logs** (array) - Optional - An array of log entries related to the problem. - **logLevel** (string) - Required - The severity level of the log. - **message** (string) - Required - The log message content. ### Request Example ```json { "analysisId": "analysis-111-aaa", "problemDetails": { "description": "Code suggestions are not appearing.", "logs": [ { "logLevel": "ERROR", "message": "Failed to connect to suggestion service." } ] } } ``` ### Response #### Success Response (200) - **analysisId** (string) - The identifier of the initiated analysis. - **status** (string) - The status of the analysis initiation. #### Response Example ```json { "analysisId": "analysis-111-aaa", "status": "STARTED" } ``` ``` -------------------------------- ### StartTransformation Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Starts a transformation process. ```APIDOC ## POST /StartTransformation ### Description Starts a transformation process. ### Method POST ### Endpoint /StartTransformation ### Request Body - **transformationRequest** (object) - Required - The request object for the transformation. - **transformationId** (string) - Required - The ID of the transformation to start. - **sourceCodeLocation** (string) - Required - The location of the source code. - **targetCodeLocation** (string) - Required - The location for the transformed code. ### Request Example ```json { "transformationRequest": { "transformationId": "string", "sourceCodeLocation": "string", "targetCodeLocation": "string" } } ``` ### Response #### Success Response (200) - **transformationId** (string) - The ID of the started transformation. #### Response Example ```json { "transformationId": "string" } ``` ``` -------------------------------- ### Webview Client Factory Example Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/arch_develop.md Instantiate a webview client using `WebviewClientFactory`. This generates a proxy for sending messages to the extension, mapping function names to command names and handling unique request IDs. ```typescript const client = WebviewClientFactory.create(webview); // Example of sending a message client.myCommand("some argument").then(response => { console.log("Received response:", response); }).catch(error => { console.error("Error sending message:", error); }); ``` -------------------------------- ### StartTaskAssistCodeGeneration Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Starts code generation for a task assist request. ```APIDOC ## POST /StartTaskAssistCodeGeneration ### Description Starts code generation for a task assist request. ### Method POST ### Endpoint /StartTaskAssistCodeGeneration ### Request Body - **taskAssistCodeGenerationRequest** (object) - Required - The request object for task assist code generation. - **prompt** (string) - Required - The user's prompt for code generation. - **language** (string) - Required - The programming language for the generated code. - **context** (object) - Optional - Contextual information for code generation. ### Request Example ```json { "taskAssistCodeGenerationRequest": { "prompt": "string", "language": "string", "context": {} } } ``` ### Response #### Success Response (200) - **codeGenerationId** (string) - The ID of the initiated code generation task. #### Response Example ```json { "codeGenerationId": "string" } ``` ``` -------------------------------- ### Configure VSCode Settings Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/vscode-config.md Example settings.json to expose local ports for a Vue application and set the default Python interpreter path. ```json { "remote.portsAttributes": { "5173": { "label": "Vue Application" } }, "remote.SSH.defaultForwardedPorts": [ { "localPort": 5173, "name": "Vue Application Port", "remotePort": 5173 } ], "python.defaultInterpreterPath": "python" } ``` -------------------------------- ### StartTestGeneration Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Starts the generation of unit tests for the provided code. ```APIDOC ## POST /StartTestGeneration ### Description Starts the generation of unit tests for the provided code. ### Method POST ### Endpoint /StartTestGeneration ### Request Body - **testGenerationRequest** (object) - Required - The request object for test generation. - **filePath** (string) - Required - The path to the file for which to generate tests. - **fileContent** (string) - Required - The content of the file. - **language** (string) - Required - The programming language of the file. ### Request Example ```json { "testGenerationRequest": { "filePath": "string", "fileContent": "string", "language": "string" } } ``` ### Response #### Success Response (200) - **testGenerationId** (string) - The ID of the initiated test generation task. #### Response Example ```json { "testGenerationId": "string" } ``` ``` -------------------------------- ### StartCodeFixJobCommand Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Starts a code fix job. This command is part of the QDeveloperStreaming service. ```APIDOC ## POST /StartCodeFixJob ### Description Starts a code fix job. ### Method POST ### Endpoint /StartCodeFixJob ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body Refer to the Input documentation for details on the request body structure. ### Request Example ```json { "example": "request body for StartCodeFixJob" } ``` ### Response #### Success Response (200) Refer to the Output documentation for details on the success response structure. #### Response Example ```json { "example": "response body for StartCodeFixJob" } ``` ``` -------------------------------- ### Basic Function Structure Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/telemetry.md Illustrates a function with multiple setup steps, representing a workflow. ```typescript function setupThing() { setupStep1() setupStep2() ... lastSetupStep() } ``` -------------------------------- ### Troubleshooting Exceptions and Metadata Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Example of how to catch exceptions from the client.send operation and access metadata like requestId, cfId, and extendedRequestId. ```javascript try { const data = await client.send(command); // process data. } catch (error) { const { requestId, cfId, extendedRequestId } = error.$metadata; console.log({ requestId, cfId, extendedRequestId }); /** * The keys within exceptions are also parsed. * You can access them by specifying exception names: * if (error.name === 'SomeServiceException') { * const value = error.specialKeyInException; * } */ } ``` -------------------------------- ### Launch Chrome with Security Disabled (macOS) Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/web.md Start Google Chrome from the command line with web security disabled to test CORS compatibility on macOS. ```bash /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security ``` -------------------------------- ### Initialize Client and Command Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Instantiate the QDeveloperStreamingClient with configuration and create a command object with input parameters. ```javascript const client = new QDeveloperStreamingClient({ region: "REGION" }); const params = { /** input parameters */ }; const command = new SendMessageCommand(params); ``` -------------------------------- ### Generate Dependency Graph with dependency-cruiser Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/web.md Use this command to generate a dependency graph to visualize imports and identify transitive dependencies. Ensure Graphviz is installed and dependency-cruiser is temporarily installed. ```bash npx depcruise src/shared/fs/fs.ts --reaches "fs-extra" --output-type dot | dot -T svg > dependency-graph.svg ``` -------------------------------- ### v2 Compatible Style Initialization and Usage Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Demonstrates how to use the client in a v2 compatible style, which may result in a larger bundle size. Includes async/await, Promises, and callbacks. ```typescript import * as AWS from "@amzn/amazon-q-developer-streaming-client"; const client = new AWS.QDeveloperStreaming({ region: "REGION" }); // async/await. try { const data = await client.sendMessage(params); // process data. } catch (error) { // error handling. } // Promises. client .sendMessage(params) .then((data) => { // process data. }) .catch((error) => { // error handling. }); // callbacks. client.sendMessage(params, (err, data) => { // process err and data. }); ``` -------------------------------- ### Example of Schema Change for 'anyOf' Fix Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/cfn-schema-support.md This example references a pull request that fixed an issue related to 'anyOf' properties in JSON schemas, which can cause validation confusion for the yaml-language-server. Updating the schema type is often required. ```markdown See PRs: [#450](https://github.com/awslabs/goformation/pull/450), [#448](https://github.com/awslabs/goformation/pull/448), [#449](https://github.com/awslabs/goformation/pull/449) for examples ``` -------------------------------- ### Import QDeveloperStreamingClient (ES5) Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Import the QDeveloperStreamingClient and necessary commands for ES5 environments. ```javascript const { QDeveloperStreamingClient, SendMessageCommand } = require("@amzn/amazon-q-developer-streaming-client"); ``` -------------------------------- ### Example of Schema Resource Property Mismatch Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/cfn-schema-support.md This example highlights a schema change where a 'Resource' property was updated to match AWS documentation specifications. This is relevant when the schema's definition of resource properties differs from the official AWS documentation. ```diff Similiar to [this change](https://github.com/awslabs/goformation/pull/449/files#diff-f6615b52e8a9fb8465ba150df1fdba3ce3ce7a262a43fa2e5c5f0d4057c09456R1669) ``` -------------------------------- ### Initialize Client and Command Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Instantiate a CodeWhispererStreamingClient with configuration and create a SendMessageCommand with input parameters. ```javascript const client = new CodeWhispererStreamingClient({ region: "REGION" }); const params = { /** input parameters */ }; const command = new SendMessageCommand(params); ``` -------------------------------- ### Import QDeveloperStreamingClient (ES6+) Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Import the QDeveloperStreamingClient and necessary commands for ES6+ environments. ```typescript import { QDeveloperStreamingClient, SendMessageCommand } from "@amzn/amazon-q-developer-streaming-client"; ``` -------------------------------- ### StartCodeAnalysis Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Starts a code analysis for the provided code. ```APIDOC ## POST /StartCodeAnalysis ### Description Starts a code analysis for the provided code. ### Method POST ### Endpoint /StartCodeAnalysis ### Request Body - **codeAnalysisRequest** (object) - Required - The request object for code analysis. - **filePath** (string) - Required - The path to the file to analyze. - **fileContent** (string) - Required - The content of the file. - **language** (string) - Required - The programming language of the file. ### Request Example ```json { "codeAnalysisRequest": { "filePath": "string", "fileContent": "string", "language": "string" } } ``` ### Response #### Success Response (200) - **codeAnalysisId** (string) - The ID of the initiated code analysis. #### Response Example ```json { "codeAnalysisId": "string" } ``` ``` -------------------------------- ### StartTestGenerationCommand Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Initiates test generation. This command is part of the QDeveloperStreaming service. ```APIDOC ## POST /StartTestGeneration ### Description Starts test generation. ### Method POST ### Endpoint /StartTestGeneration ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body Refer to the Input documentation for details on the request body structure. ### Request Example ```json { "example": "request body for StartTestGeneration" } ``` ### Response #### Success Response (200) Refer to the Output documentation for details on the success response structure. #### Response Example ```json { "example": "response body for StartTestGeneration" } ``` ``` -------------------------------- ### StartCodeFixJob Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Starts a code fix job for the given code and issue. ```APIDOC ## POST /StartCodeFixJob ### Description Starts a code fix job for the given code and issue. ### Method POST ### Endpoint /StartCodeFixJob ### Request Body - **codeFixJobRequest** (object) - Required - The request object for the code fix job. - **filePath** (string) - Required - The path to the file with the issue. - **fileContent** (string) - Required - The content of the file. - **issueDescription** (string) - Required - A description of the issue. - **language** (string) - Required - The programming language of the file. ### Request Example ```json { "codeFixJobRequest": { "filePath": "string", "fileContent": "string", "issueDescription": "string", "language": "string" } } ``` ### Response #### Success Response (200) - **codeFixJobId** (string) - The ID of the initiated code fix job. #### Response Example ```json { "codeFixJobId": "string" } ``` ``` -------------------------------- ### StartTroubleshootingResolutionExplanationCommand API Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Reference for the StartTroubleshootingResolutionExplanationCommand, including links to its input and output types. ```APIDOC ## StartTroubleshootingResolutionExplanationCommand API ### Description Provides reference for the StartTroubleshootingResolutionExplanationCommand. ### Method POST ### Endpoint /aws/qdeveloperstreaming ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body Refer to the [Input documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qdeveloperstreaming/Interface/StartTroubleshootingResolutionExplanationCommandInput/) ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) Refer to the [Output documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qdeveloperstreaming/Interface/StartTroubleshootingResolutionExplanationCommandOutput/) #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### InvokeTask API Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Invokes a task. This operation starts the execution of a specific task. ```APIDOC ## POST /tasks/{taskId}:invoke ### Description Invokes a task. ### Method POST ### Endpoint /tasks/{taskId}:invoke ### Parameters #### Path Parameters - **taskId** (string) - Required - The unique identifier of the task to invoke. #### Request Body - **input** (object) - Optional - The input payload for the task. ### Response #### Success Response (200) - **result** (object) - The result of the task execution. ``` -------------------------------- ### Scan Licenses with npm Source: https://github.com/aws/aws-toolkit-vscode/blob/master/README.md Run this command to generate license reports and attribution documents for third-party dependencies. ```bash npm run scan-licenses ``` -------------------------------- ### Run All Tests from Command Line Source: https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md Execute all project tests using npm scripts. Logs are written to ./.test-reports/testLog.log. ```bash npm run test ``` ```bash npm run testInteg ``` -------------------------------- ### Get Task API Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Retrieves a task. This operation is part of the CodeWhisperer Streaming API. ```APIDOC ## GET /tasks/{taskId} ### Description Retrieves a specific task identified by its ID. ### Method GET ### Endpoint /tasks/{taskId} ### Parameters #### Path Parameters - **taskId** (string) - Required - The unique identifier of the task to retrieve. ### Response #### Success Response (200) Returns the details of the specified task. #### Response Example (No specific response body example provided in source) ``` -------------------------------- ### Get Plugin API Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Retrieves a plugin. This operation is part of the CodeWhisperer Streaming API. ```APIDOC ## GET /plugins/{pluginId} ### Description Retrieves a specific plugin identified by its ID. ### Method GET ### Endpoint /plugins/{pluginId} ### Parameters #### Path Parameters - **pluginId** (string) - Required - The unique identifier of the plugin to retrieve. ### Response #### Success Response (200) Returns the details of the specified plugin. #### Response Example (No specific response body example provided in source) ``` -------------------------------- ### Access Project Information with sagemaker_studio.Project Source: https://github.com/aws/aws-toolkit-vscode/blob/master/packages/core/resources/smus-context-template.md Instantiate the Project class to access project details such as ID, name, IAM role, KMS key ARN, MLflow tracking server ARN, and the project's S3 root path. ```python from sagemaker_studio import Project project = Project() project.id project.name project.iam_role # project IAM role ARN project.kms_key_arn # project KMS key ARN (if configured) project.mlflow_tracking_server_arn # MLflow ARN (if configured) project.s3.root # project S3 root path ``` -------------------------------- ### Create Webview Client on Frontend Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/arch_develop.md Instantiate a webview client on the frontend using the WebviewClientFactory, specifying the backend interface type. ```typescript import { MyView } from './backend.ts' const client = WebviewClientFactory.create() ``` -------------------------------- ### Get Extension API Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Retrieves an extension. This operation is part of the CodeWhisperer Streaming API. ```APIDOC ## GET /extensions/{extensionId} ### Description Retrieves a specific extension identified by its ID. ### Method GET ### Endpoint /extensions/{extensionId} ### Parameters #### Path Parameters - **extensionId** (string) - Required - The unique identifier of the extension to retrieve. ### Response #### Success Response (200) Returns the details of the specified extension. #### Response Example (No specific response body example provided in source) ``` -------------------------------- ### Get Conversation API Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Retrieves a conversation. This operation is part of the CodeWhisperer Streaming API. ```APIDOC ## GET /conversations/{conversationId} ### Description Retrieves a specific conversation identified by its ID. ### Method GET ### Endpoint /conversations/{conversationId} ### Parameters #### Path Parameters - **conversationId** (string) - Required - The unique identifier of the conversation to retrieve. ### Response #### Success Response (200) Returns the details of the specified conversation. #### Response Example (No specific response body example provided in source) ``` -------------------------------- ### CreateResolutionCommand Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Creates a new resolution within the QDeveloperStreaming service. ```APIDOC ## POST /api/qdeveloperstreaming/CreateResolution ### Description Creates a new resolution for a given conversation or task. ### Method POST ### Endpoint /api/qdeveloperstreaming/CreateResolution ### Parameters #### Request Body - **input** (CreateResolutionCommandInput) - Required - The input structure for creating a resolution. ### Request Example ```json { "input": { "clientToken": "string", "conversationId": "string", " 0": "string" } } ``` ### Response #### Success Response (200) - **output** (CreateResolutionCommandOutput) - The output structure confirming the creation of the resolution. #### Response Example ```json { "output": { "resolutionId": "string", " 0": "string" } } ``` ``` -------------------------------- ### Get Connector API Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Retrieves information about a connector. This operation is part of the CodeWhisperer Streaming API. ```APIDOC ## GET /connectors/{connectorId} ### Description Retrieves details for a specific connector identified by its ID. ### Method GET ### Endpoint /connectors/{connectorId} ### Parameters #### Path Parameters - **connectorId** (string) - Required - The unique identifier of the connector to retrieve. ### Response #### Success Response (200) Returns details of the specified connector. #### Response Example (No specific response body example provided in source) ``` -------------------------------- ### ListAvailableCustomizationsCommand Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Provides API reference, input, and output details for the ListAvailableCustomizationsCommand. ```APIDOC ## GET /api/qdeveloperstreaming/ListAvailableCustomizationsCommand ### Description Lists available customizations for the Q service. ### Method GET ### Endpoint /api/qdeveloperstreaming/ListAvailableCustomizationsCommand ### Parameters #### Query Parameters - **maxResults** (integer) - Optional - The maximum number of customizations to return. - **nextToken** (string) - Optional - A token to retrieve the next page of results. ### Request Example ```json { "maxResults": 10, "nextToken": "example-next-token" } ``` ### Response #### Success Response (200) - **customizations** (array) - A list of available customizations. - **nextToken** (string) - A token to retrieve the next page of results, if any. #### Response Example ```json { "customizations": [ { "id": "custom-1", "name": "Customization Alpha" } ], "nextToken": "example-next-token" } ``` ``` -------------------------------- ### Create a Quick Pick Prompter Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/arch_develop.md Create a QuickPickPrompter with specific data types by passing an array of items to the createQuickPick function. ```typescript // Results in `QuickPickPrompter` const prompter = createQuickPick([item]) ``` ```typescript // Results in `QuickPickPrompter` const prompter = createQuickPick([{ label: 'Another item', data: 0 }]) ``` -------------------------------- ### GetIdentityMetadata API Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Retrieves identity metadata. This operation is used to get metadata related to user identity. ```APIDOC ## GET /identity-metadata ### Description Retrieves identity metadata. ### Method GET ### Endpoint /identity-metadata ### Response #### Success Response (200) - **identityMetadata** (IdentityMetadata) - The identity metadata object. ``` -------------------------------- ### VSCode Project Structure Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/vscode-config.md Illustrates the required folder structure for VSCode settings files within a project. ```text project_root/ .vscode/ settings.json extensions.json tasks.json launch.json ``` ```text my_frontend_application/ main.js my_backend_application/ main.py .vscode/ settings.json extensions.json launch.json tasks.json ``` -------------------------------- ### Get Troubleshooting Results API Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Retrieves troubleshooting results. This operation is part of the CodeWhisperer Streaming API. ```APIDOC ## GET /troubleshooting-results/{resultId} ### Description Retrieves the results of a troubleshooting operation identified by its ID. ### Method GET ### Endpoint /troubleshooting-results/{resultId} ### Parameters #### Path Parameters - **resultId** (string) - Required - The unique identifier of the troubleshooting results to retrieve. ### Response #### Success Response (200) Returns the troubleshooting results. #### Response Example (No specific response body example provided in source) ``` -------------------------------- ### CreateExtensionCommand Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Creates a new extension within the QDeveloperStreaming service. ```APIDOC ## POST /api/qdeveloperstreaming/CreateExtension ### Description Creates a new extension to enhance the functionality of the QDeveloperStreaming service. ### Method POST ### Endpoint /api/qdeveloperstreaming/CreateExtension ### Parameters #### Request Body - **input** (CreateExtensionCommandInput) - Required - The input structure for creating an extension. ### Request Example ```json { "input": { "clientToken": "string", "description": "string", "name": "string", " 0": "string" } } ``` ### Response #### Success Response (200) - **output** (CreateExtensionCommandOutput) - The output structure confirming the creation of the extension. #### Response Example ```json { "output": { "extensionArn": "string", "extensionId": "string", " 0": "string" } } ``` ``` -------------------------------- ### StartTroubleshootingAnalysisCommand API Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Reference for the StartTroubleshootingAnalysisCommand, including links to its input and output types. ```APIDOC ## StartTroubleshootingAnalysisCommand API ### Description Provides reference for the StartTroubleshootingAnalysisCommand. ### Method POST ### Endpoint /aws/qdeveloperstreaming ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body Refer to the [Input documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qdeveloperstreaming/Interface/StartTroubleshootingAnalysisCommandInput/) ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) Refer to the [Output documentation](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-qdeveloperstreaming/Interface/StartTroubleshootingAnalysisCommandOutput/) #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Get Identity Metadata API Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Retrieves identity metadata. This operation is part of the CodeWhisperer Streaming API. ```APIDOC ## GET /identity-metadata ### Description Retrieves metadata related to user identity. ### Method GET ### Endpoint /identity-metadata ### Response #### Success Response (200) Returns identity metadata. #### Response Example (No specific response body example provided in source) ``` -------------------------------- ### UsePluginCommand Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Provides API reference, input, and output details for the UsePluginCommand. ```APIDOC ## UsePluginCommand ### Description Allows the use of a specific plugin within a conversation. ### Method POST ### Endpoint /qdeveloperstreaming ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **conversationId** (string) - Required - The ID of the conversation. - **pluginId** (string) - Required - The ID of the plugin to use. - **clientToken** (string) - Optional - A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. ### Request Example ```json { "conversationId": "string", "pluginId": "string", "clientToken": "string" } ``` ### Response #### Success Response (200) - **conversationId** (string) - The ID of the conversation. #### Response Example ```json { "conversationId": "string" } ``` ``` -------------------------------- ### Example Trace ID Propagation Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/telemetry.md Illustrates how a single traceId is associated with multiple related telemetry events in a flow. ```text vscode_executeCommand: traceId: 'aaaaa-aaaaa-aaaaa-aaaaa-aaaaa' amazonq_enterFocusChat traceId: 'aaaaa-aaaaa-aaaaa-aaaaa-aaaaa' amazonq_openChat traceId: 'aaaaa-aaaaa-aaaaa-aaaaa-aaaaa' ``` -------------------------------- ### Get Codicon Icon Source: https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md Use this function to retrieve a codicon by its ID. Ensure the icon is properly registered in package.json. ```typescript getIcon('aws-cloudwatch-log-stream') ``` -------------------------------- ### Build and Watch for Changes with NPM Source: https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md Builds the project and continues to watch for file changes, recompiling as needed. Useful during active development. ```bash npm run watch ``` -------------------------------- ### CreatePluginCommand Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Creates a new plugin within the QDeveloperStreaming service. ```APIDOC ## POST /api/qdeveloperstreaming/CreatePlugin ### Description Creates a new plugin to extend the capabilities of the QDeveloperStreaming service. ### Method POST ### Endpoint /api/qdeveloperstreaming/CreatePlugin ### Parameters #### Request Body - **input** (CreatePluginCommandInput) - Required - The input structure for creating a plugin. ### Request Example ```json { "input": { "clientToken": "string", "description": "string", "logo": "string", "name": "string", " 0": "string" } } ``` ### Response #### Success Response (200) - **output** (CreatePluginCommandOutput) - The output structure confirming the creation of the plugin. #### Response Example ```json { "output": { "pluginArn": "string", "pluginId": "string", " 0": "string" } } ``` ``` -------------------------------- ### aws.codeWhisperer.connect Command Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/api.md Shortcut command to connect to Identity Center or prompt for start URL entry, and set a customization for CodeWhisperer requests. ```APIDOC ## POST /aws/codeWhisperer/connect ### Description Connects to Identity Center or prompts for start URL entry, and sets a customization for CodeWhisperer requests. ### Method POST ### Endpoint /aws/codeWhisperer/connect ### Parameters #### Query Parameters - **source** (string) - Required - An identifier of the caller of this command for telemetry. - **startUrl** (string) - Optional - The start URL for the connection. - **region** (string) - Optional - The region for the connection. If both `startUrl` and `region` are provided, they will be used; otherwise, the command prompts for them interactively. - **customizationArn** (string) - Optional - Select customization by ARN. If provided, `customizationNamePrefix` is ignored. - **customizationNamePrefix** (string) - Optional - Select customization by prefix, if `customizationArn` is undefined. ### Request Example ```json { "source": "my-extension", "startUrl": "https://my-identity-center.awsapps.com/start", "region": "us-east-1", "customizationArn": "arn:aws:codewhisperer:us-east-1:123456789012:customization/abcdef1234567890" } ``` ### Response #### Success Response (200) - **void** - This command does not return a value upon successful execution. #### Response Example (No response body for success) ``` -------------------------------- ### StartCodeAnalysisCommand Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Initiates a code analysis process. This command is part of the QDeveloperStreaming service. ```APIDOC ## POST /StartCodeAnalysis ### Description Starts a code analysis process. ### Method POST ### Endpoint /StartCodeAnalysis ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body Refer to the Input documentation for details on the request body structure. ### Request Example ```json { "example": "request body for StartCodeAnalysis" } ``` ### Response #### Success Response (200) Refer to the Output documentation for details on the success response structure. #### Response Example ```json { "example": "response body for StartCodeAnalysis" } ``` ``` -------------------------------- ### Build Once with NPM Source: https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md Compiles the project once. Use this for a single build without continuous watching. ```bash npm run compile ``` -------------------------------- ### Incrementally Building a Metric with run() and record() Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/telemetry.md Demonstrates using `telemetry.metric_setupThing.run()` to manage metric attributes across nested calls. Attributes recorded within the `run()` callback are applied to the final emitted metric. Exceptions thrown from the callback automatically set the `result` to 'Failed' and `reason` based on the error code. ```typescript setupThing() function setupThing() { // Start the run() for metric_setupThing telemetry.metric_setupThing.run(span => { // Update the metric with initial attributes span.record({sessionId: '123456'}) // now no matter where the control flow exits after this line in this method, this attribute will always be set ... setupStep2() ... if (userInput.CancelSelected) { // By setting the `cancelled` attribute to true, the `result` attribute will be set to Cancelled throw new ToolkitError("Thing has been cancelled", { cancelled: true}) } }) // At this point the final values from the `record()` calls are used to emit a the final metric. // If no exceptions have been thrown, the `result` attribute is automatically set to Success. } function setupStep2() { try { // Do work } catch (e) { // Here we can update the metric with more specific information regarding the failure. // Also notice we are able to use `telemetry.metric_setupThing` versus `span`. // This is due to `metric_setupThing` being added to the "context" from the above run() // callback argument. So when we use record() below it will update the same // thing that span.record() does. // Keep in mind record() must be run inside the callback argument of run() for // the attributes of that specific metric to be updated. telemetry.metric_setupThing.record({ workDone: // ... }) // If this exception is allowed to propogate to the `run()`, then the `result` will be automatically set to Failed and the `reason` to the `code` set here throw new ToolkitError(e as Error, { code: "SomethingWentWrongInStep2"}) } } ``` -------------------------------- ### Send Command using Async/await Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/amazon-q-developer-streaming-client/README.md Use the async/await syntax to send a command and handle the response or errors. This is the recommended approach for its clarity and error handling. ```javascript async/await. try { const data = await client.send(command); // process data. } catch (error) { // error handling. } finally { // finally. } ``` -------------------------------- ### Record Additional Telemetry Information Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/telemetry.md Annotate the current telemetry metric with additional information by calling `telemetry.record()` within a `telemetry.foo.run(...)` context. This example shows adding `hasTimeFilter` info. ```typescript telemetry.record({ hasTimeFilter: true }) ``` -------------------------------- ### Example of Incorrect Type Validation Source: https://github.com/aws/aws-toolkit-vscode/blob/master/docs/cfn-schema-support.md This YAML snippet demonstrates an 'Incorrect type' validation error where 'Policies' is expected to be an array but is provided as a boolean. This often occurs when the YAML does not semantically align with the JSON schema. ```yaml Type: AWS::Serverless::Function Properties: Policies: false ``` -------------------------------- ### Interact with Catalogs, Databases, and Tables Source: https://github.com/aws/aws-toolkit-vscode/blob/master/packages/core/resources/smus-context-template.md Access and navigate project data catalogs, databases, and tables. Retrieve databases from a connection's catalog, list tables within a database, and inspect table columns. ```python catalog = project.connection().catalog() # default catalog catalog = project.connection().catalog("catalog_id") catalog.databases # list databases db = catalog.database("my_db") db.tables # list tables table = db.table("my_table") table.columns # list columns (name, type) ``` -------------------------------- ### StartTroubleshootingResolutionExplanation Source: https://github.com/aws/aws-toolkit-vscode/blob/master/src.gen/@amzn/codewhisperer-streaming/README.md Requests an explanation for a troubleshooting resolution in the CodeWhisperer streaming service. ```APIDOC ## POST / StartTroubleshootingResolutionExplanation ### Description Requests an explanation for a proposed resolution to a troubleshooting issue. ### Method POST ### Endpoint /StartTroubleshootingResolutionExplanation ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **explanationId** (string) - Required - A unique identifier for this explanation request. - **resolution** (object) - Required - Details about the proposed resolution. - **description** (string) - Required - A description of the resolution steps. - **suggestedAction** (string) - Optional - The action suggested to resolve the issue. ### Request Example ```json { "explanationId": "explanation-222-bbb", "resolution": { "description": "Restart the CodeWhisperer extension and check network connectivity.", "suggestedAction": "RESTART_EXTENSION" } } ``` ### Response #### Success Response (200) - **explanationId** (string) - The identifier for the requested explanation. - **status** (string) - The status of the explanation request. #### Response Example ```json { "explanationId": "explanation-222-bbb", "status": "PENDING" } ``` ```