- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetBranchCommand
Returns 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, GetBranchCommand } from "@aws-sdk/client-amplify"; // ES Modules import
// const { AmplifyClient, GetBranchCommand } = require("@aws-sdk/client-amplify"); // CommonJS import
const client = new AmplifyClient(config);
const input = { // GetBranchRequest
appId: "STRING_VALUE", // required
branchName: "STRING_VALUE", // required
};
const command = new GetBranchCommand(input);
const response = await client.send(command);
// { // GetBranchResult
// 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
// 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",
// },
// },
// };
GetBranchCommand Input
See GetBranchCommandInput for more details
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
appId Required | string | undefined | The unique ID for an Amplify app. |
branchName Required | string | undefined | The name of the branch. |
GetBranchCommand Output
See GetBranchCommandOutput for details
Parameter | Type | Description |
---|
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 |
---|
Name | Fault | Details |
---|---|---|
BadRequestException | client | A request contains unexpected data. |
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. |