DeleteBranchCommand

Deletes a branch for an Amplify app.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { AmplifyClient, DeleteBranchCommand } from "@aws-sdk/client-amplify"; // ES Modules import
// const { AmplifyClient, DeleteBranchCommand } = require("@aws-sdk/client-amplify"); // CommonJS import
const client = new AmplifyClient(config);
const input = { // DeleteBranchRequest
  appId: "STRING_VALUE", // required
  branchName: "STRING_VALUE", // required
};
const command = new DeleteBranchCommand(input);
const response = await client.send(command);
// { // DeleteBranchResult
//   branch: { // Branch
//     branchArn: "STRING_VALUE", // required
//     branchName: "STRING_VALUE", // required
//     description: "STRING_VALUE", // required
//     tags: { // TagMap
//       "<keys>": "STRING_VALUE",
//     },
//     stage: "PRODUCTION" || "BETA" || "DEVELOPMENT" || "EXPERIMENTAL" || "PULL_REQUEST", // required
//     displayName: "STRING_VALUE", // required
//     enableNotification: true || false, // required
//     createTime: new Date("TIMESTAMP"), // required
//     updateTime: new Date("TIMESTAMP"), // required
//     environmentVariables: { // EnvironmentVariables // required
//       "<keys>": "STRING_VALUE",
//     },
//     enableAutoBuild: true || false, // required
//     enableSkewProtection: true || false,
//     customDomains: [ // CustomDomains // required
//       "STRING_VALUE",
//     ],
//     framework: "STRING_VALUE", // required
//     activeJobId: "STRING_VALUE", // required
//     totalNumberOfJobs: "STRING_VALUE", // required
//     enableBasicAuth: true || false, // required
//     enablePerformanceMode: true || false,
//     thumbnailUrl: "STRING_VALUE",
//     basicAuthCredentials: "STRING_VALUE",
//     buildSpec: "STRING_VALUE",
//     ttl: "STRING_VALUE", // required
//     associatedResources: [ // AssociatedResources
//       "STRING_VALUE",
//     ],
//     enablePullRequestPreview: true || false, // required
//     pullRequestEnvironmentName: "STRING_VALUE",
//     destinationBranch: "STRING_VALUE",
//     sourceBranch: "STRING_VALUE",
//     backendEnvironmentArn: "STRING_VALUE",
//     backend: { // Backend
//       stackArn: "STRING_VALUE",
//     },
//     computeRoleArn: "STRING_VALUE",
//   },
// };

DeleteBranchCommand Input

See DeleteBranchCommandInput for more details

Parameter
Type
Description
appId
Required
string | undefined

The unique ID for an Amplify app.

branchName
Required
string | undefined

The name of the branch.

DeleteBranchCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
branch
Required
Branch | undefined

The branch for an Amplify app, which maps to a third-party repository branch.

Throws

Name
Fault
Details
BadRequestException
client

A request contains unexpected data.

DependentServiceFailureException
server

An operation failed because a dependent service threw an exception.

InternalFailureException
server

The service failed to perform an operation due to an internal issue.

NotFoundException
client

An entity was not found during an operation.

UnauthorizedException
client

An operation failed due to a lack of access.

AmplifyServiceException
Base exception class for all service exceptions from Amplify service.