You are viewing the documentation for an older major version of the AWS SDK for JavaScript.
The modular AWS SDK for JavaScript (v3), the latest major version of AWS SDK for JavaScript, is now stable and recommended for general use. For more information, see the Migration Guide and API Reference.

Class: AWS.CodeCommit

Inherits:
AWS.Service show all
Identifier:
codecommit
API Version:
2015-04-13
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

This is the AWS CodeCommit API Reference. This reference provides descriptions of the operations and data types for AWS CodeCommit API along with usage examples.

You can use the AWS CodeCommit API to work with the following objects:

Repositories, by calling the following:

  • BatchGetRepositories, which returns information about one or more repositories associated with your AWS account.

  • CreateRepository, which creates an AWS CodeCommit repository.

  • DeleteRepository, which deletes an AWS CodeCommit repository.

  • GetRepository, which returns information about a specified repository.

  • ListRepositories, which lists all AWS CodeCommit repositories associated with your AWS account.

  • UpdateRepositoryDescription, which sets or updates the description of the repository.

  • UpdateRepositoryName, which changes the name of the repository. If you change the name of a repository, no other users of that repository can access it until you send them the new HTTPS or SSH URL to use.

Branches, by calling the following:

  • CreateBranch, which creates a branch in a specified repository.

  • DeleteBranch, which deletes the specified branch in a repository unless it is the default branch.

  • GetBranch, which returns information about a specified branch.

  • ListBranches, which lists all branches for a specified repository.

  • UpdateDefaultBranch, which changes the default branch for a repository.

Files, by calling the following:

  • DeleteFile, which deletes the content of a specified file from a specified branch.

  • GetBlob, which returns the base-64 encoded content of an individual Git blob object in a repository.

  • GetFile, which returns the base-64 encoded content of a specified file.

  • GetFolder, which returns the contents of a specified folder or directory.

  • PutFile, which adds or modifies a single file in a specified repository and branch.

Commits, by calling the following:

  • BatchGetCommits, which returns information about one or more commits in a repository.

  • CreateCommit, which creates a commit for changes to a repository.

  • GetCommit, which returns information about a commit, including commit messages and author and committer information.

  • GetDifferences, which returns information about the differences in a valid commit specifier (such as a branch, tag, HEAD, commit ID, or other fully qualified reference).

Merges, by calling the following:

  • BatchDescribeMergeConflicts, which returns information about conflicts in a merge between commits in a repository.

  • CreateUnreferencedMergeCommit, which creates an unreferenced commit between two branches or commits for the purpose of comparing them and identifying any potential conflicts.

  • DescribeMergeConflicts, which returns information about merge conflicts between the base, source, and destination versions of a file in a potential merge.

  • GetMergeCommit, which returns information about the merge between a source and destination commit.

  • GetMergeConflicts, which returns information about merge conflicts between the source and destination branch in a pull request.

  • GetMergeOptions, which returns information about the available merge options between two branches or commit specifiers.

  • MergeBranchesByFastForward, which merges two branches using the fast-forward merge option.

  • MergeBranchesBySquash, which merges two branches using the squash merge option.

  • MergeBranchesByThreeWay, which merges two branches using the three-way merge option.

Pull requests, by calling the following:

Approval rule templates, by calling the following:

Comments in a repository, by calling the following:

Tags used to tag resources in AWS CodeCommit (not Git tags), by calling the following:

  • ListTagsForResource, which gets information about AWS tags for a specified Amazon Resource Name (ARN) in AWS CodeCommit.

  • TagResource, which adds or updates tags for a resource in AWS CodeCommit.

  • UntagResource, which removes tags for a resource in AWS CodeCommit.

Triggers, by calling the following:

  • GetRepositoryTriggers, which returns information about triggers configured for a repository.

  • PutRepositoryTriggers, which replaces all triggers for a repository and can be used to create or delete triggers.

  • TestRepositoryTriggers, which tests the functionality of a repository trigger by sending data to the trigger target.

For information about how to use AWS CodeCommit, see the AWS CodeCommit User Guide.

Sending a Request Using CodeCommit

var codecommit = new AWS.CodeCommit();
codecommit.associateApprovalRuleTemplateWithRepository(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the CodeCommit object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var codecommit = new AWS.CodeCommit({apiVersion: '2015-04-13'});

You can also set the API version globally in AWS.config.apiVersions using the codecommit service identifier:

AWS.config.apiVersions = {
  codecommit: '2015-04-13',
  // other service API versions
};

var codecommit = new AWS.CodeCommit();

Version:

  • 2015-04-13

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.CodeCommit(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a CodeCommit object

var codecommit = new AWS.CodeCommit({apiVersion: '2015-04-13'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String|AWS.Endpoint)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com' or an Endpoint object.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.CodeCommit.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.CodeCommit.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.CodeCommit.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied. The function is only called for retryable errors.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean|undefined)

    whether to call operations with endpoints given by service dynamically. Setting this

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

associateApprovalRuleTemplateWithRepository(params = {}, callback) ⇒ AWS.Request

Creates an association between an approval rule template and a specified repository. Then, the next time a pull request is created in the repository where the destination reference (if specified) matches the destination reference (branch) for the pull request, an approval rule that matches the template conditions is automatically created for that pull request. If no destination references are specified in the template, an approval rule that matches the template contents is created for all pull requests in that repository.

Examples:

Calling the associateApprovalRuleTemplateWithRepository operation

var params = {
  approvalRuleTemplateName: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.associateApprovalRuleTemplateWithRepository(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • approvalRuleTemplateName — (String)

      The name for the approval rule template.

    • repositoryName — (String)

      The name of the repository that you want to associate with the template.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

batchAssociateApprovalRuleTemplateWithRepositories(params = {}, callback) ⇒ AWS.Request

Creates an association between an approval rule template and one or more specified repositories.

Examples:

Calling the batchAssociateApprovalRuleTemplateWithRepositories operation

var params = {
  approvalRuleTemplateName: 'STRING_VALUE', /* required */
  repositoryNames: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
codecommit.batchAssociateApprovalRuleTemplateWithRepositories(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • approvalRuleTemplateName — (String)

      The name of the template you want to associate with one or more repositories.

    • repositoryNames — (Array<String>)

      The names of the repositories you want to associate with the template.

      Note: The length constraint limit is for each string in the array. The array itself can be empty.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • associatedRepositoryNames — (Array<String>)

        A list of names of the repositories that have been associated with the template.

      • errors — (Array<map>)

        A list of any errors that might have occurred while attempting to create the association between the template and the repositories.

        • repositoryName — (String)

          The name of the repository where the association was not made.

        • errorCode — (String)

          An error code that specifies whether the repository name was not valid or not found.

        • errorMessage — (String)

          An error message that provides details about why the repository name was not found or not valid.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

batchDescribeMergeConflicts(params = {}, callback) ⇒ AWS.Request

Returns information about one or more merge conflicts in the attempted merge of two commit specifiers using the squash or three-way merge strategy.

Service Reference:

Examples:

Calling the batchDescribeMergeConflicts operation

var params = {
  destinationCommitSpecifier: 'STRING_VALUE', /* required */
  mergeOption: FAST_FORWARD_MERGE | SQUASH_MERGE | THREE_WAY_MERGE, /* required */
  repositoryName: 'STRING_VALUE', /* required */
  sourceCommitSpecifier: 'STRING_VALUE', /* required */
  conflictDetailLevel: FILE_LEVEL | LINE_LEVEL,
  conflictResolutionStrategy: NONE | ACCEPT_SOURCE | ACCEPT_DESTINATION | AUTOMERGE,
  filePaths: [
    'STRING_VALUE',
    /* more items */
  ],
  maxConflictFiles: 'NUMBER_VALUE',
  maxMergeHunks: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
codecommit.batchDescribeMergeConflicts(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the merge conflicts you want to review.

    • destinationCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • sourceCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • mergeOption — (String)

      The merge option or strategy you want to use to merge the code.

      Possible values include:
      • "FAST_FORWARD_MERGE"
      • "SQUASH_MERGE"
      • "THREE_WAY_MERGE"
    • maxMergeHunks — (Integer)

      The maximum number of merge hunks to include in the output.

    • maxConflictFiles — (Integer)

      The maximum number of files to include in the output.

    • filePaths — (Array<String>)

      The path of the target files used to describe the conflicts. If not specified, the default is all conflict files.

    • conflictDetailLevel — (String)

      The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

      Possible values include:
      • "FILE_LEVEL"
      • "LINE_LEVEL"
    • conflictResolutionStrategy — (String)

      Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

      Possible values include:
      • "NONE"
      • "ACCEPT_SOURCE"
      • "ACCEPT_DESTINATION"
      • "AUTOMERGE"
    • nextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • conflicts — (Array<map>)

        A list of conflicts for each file, including the conflict metadata and the hunks of the differences between the files.

        • conflictMetadata — (map)

          Metadata about a conflict in a merge operation.

          • filePath — (String)

            The path of the file that contains conflicts.

          • fileSizes — (map)

            The file sizes of the file in the source, destination, and base of the merge.

            • source — (Integer)

              The size of a file in the source of a merge or pull request.

            • destination — (Integer)

              The size of a file in the destination of a merge or pull request.

            • base — (Integer)

              The size of a file in the base of a merge or pull request.

          • fileModes — (map)

            The file modes of the file in the source, destination, and base of the merge.

            • source — (String)

              The file mode of a file in the source of a merge or pull request.

              Possible values include:
              • "EXECUTABLE"
              • "NORMAL"
              • "SYMLINK"
            • destination — (String)

              The file mode of a file in the destination of a merge or pull request.

              Possible values include:
              • "EXECUTABLE"
              • "NORMAL"
              • "SYMLINK"
            • base — (String)

              The file mode of a file in the base of a merge or pull request.

              Possible values include:
              • "EXECUTABLE"
              • "NORMAL"
              • "SYMLINK"
          • objectTypes — (map)

            Information about any object type conflicts in a merge operation.

            • source — (String)

              The type of the object in the source branch.

              Possible values include:
              • "FILE"
              • "DIRECTORY"
              • "GIT_LINK"
              • "SYMBOLIC_LINK"
            • destination — (String)

              The type of the object in the destination branch.

              Possible values include:
              • "FILE"
              • "DIRECTORY"
              • "GIT_LINK"
              • "SYMBOLIC_LINK"
            • base — (String)

              The type of the object in the base commit of the merge.

              Possible values include:
              • "FILE"
              • "DIRECTORY"
              • "GIT_LINK"
              • "SYMBOLIC_LINK"
          • numberOfConflicts — (Integer)

            The number of conflicts, including both hunk conflicts and metadata conflicts.

          • isBinaryFile — (map)

            A boolean value (true or false) indicating whether the file is binary or textual in the source, destination, and base of the merge.

            • source — (Boolean)

              The binary or non-binary status of file in the source of a merge or pull request.

            • destination — (Boolean)

              The binary or non-binary status of a file in the destination of a merge or pull request.

            • base — (Boolean)

              The binary or non-binary status of a file in the base of a merge or pull request.

          • contentConflict — (Boolean)

            A boolean value indicating whether there are conflicts in the content of a file.

          • fileModeConflict — (Boolean)

            A boolean value indicating whether there are conflicts in the file mode of a file.

          • objectTypeConflict — (Boolean)

            A boolean value (true or false) indicating whether there are conflicts between the branches in the object type of a file, folder, or submodule.

          • mergeOperations — (map)

            Whether an add, modify, or delete operation caused the conflict between the source and destination of the merge.

            • source — (String)

              The operation (add, modify, or delete) on a file in the source of a merge or pull request.

              Possible values include:
              • "A"
              • "M"
              • "D"
            • destination — (String)

              The operation on a file in the destination of a merge or pull request.

              Possible values include:
              • "A"
              • "M"
              • "D"
        • mergeHunks — (Array<map>)

          A list of hunks that contain the differences between files or lines causing the conflict.

          • isConflict — (Boolean)

            A Boolean value indicating whether a combination of hunks contains a conflict. Conflicts occur when the same file or the same lines in a file were modified in both the source and destination of a merge or pull request. Valid values include true, false, and null. True when the hunk represents a conflict and one or more files contains a line conflict. File mode conflicts in a merge do not set this to true.

          • source — (map)

            Information about the merge hunk in the source of a merge or pull request.

            • startLine — (Integer)

              The start position of the hunk in the merge result.

            • endLine — (Integer)

              The end position of the hunk in the merge result.

            • hunkContent — (String)

              The base-64 encoded content of the hunk merged region that might contain a conflict.

          • destination — (map)

            Information about the merge hunk in the destination of a merge or pull request.

            • startLine — (Integer)

              The start position of the hunk in the merge result.

            • endLine — (Integer)

              The end position of the hunk in the merge result.

            • hunkContent — (String)

              The base-64 encoded content of the hunk merged region that might contain a conflict.

          • base — (map)

            Information about the merge hunk in the base of a merge or pull request.

            • startLine — (Integer)

              The start position of the hunk in the merge result.

            • endLine — (Integer)

              The end position of the hunk in the merge result.

            • hunkContent — (String)

              The base-64 encoded content of the hunk merged region that might contain a conflict.

      • nextToken — (String)

        An enumeration token that can be used in a request to return the next batch of the results.

      • errors — (Array<map>)

        A list of any errors returned while describing the merge conflicts for each file.

        • filePathrequired — (String)

          The path to the file.

        • exceptionNamerequired — (String)

          The name of the exception.

        • messagerequired — (String)

          The message provided by the exception.

      • destinationCommitId — (String)

        The commit ID of the destination commit specifier that was used in the merge evaluation.

      • sourceCommitId — (String)

        The commit ID of the source commit specifier that was used in the merge evaluation.

      • baseCommitId — (String)

        The commit ID of the merge base.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

batchDisassociateApprovalRuleTemplateFromRepositories(params = {}, callback) ⇒ AWS.Request

Removes the association between an approval rule template and one or more specified repositories.

Examples:

Calling the batchDisassociateApprovalRuleTemplateFromRepositories operation

var params = {
  approvalRuleTemplateName: 'STRING_VALUE', /* required */
  repositoryNames: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
codecommit.batchDisassociateApprovalRuleTemplateFromRepositories(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • approvalRuleTemplateName — (String)

      The name of the template that you want to disassociate from one or more repositories.

    • repositoryNames — (Array<String>)

      The repository names that you want to disassociate from the approval rule template.

      Note: The length constraint limit is for each string in the array. The array itself can be empty.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • disassociatedRepositoryNames — (Array<String>)

        A list of repository names that have had their association with the template removed.

      • errors — (Array<map>)

        A list of any errors that might have occurred while attempting to remove the association between the template and the repositories.

        • repositoryName — (String)

          The name of the repository where the association with the template was not able to be removed.

        • errorCode — (String)

          An error code that specifies whether the repository name was not valid or not found.

        • errorMessage — (String)

          An error message that provides details about why the repository name was either not found or not valid.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

batchGetCommits(params = {}, callback) ⇒ AWS.Request

Returns information about the contents of one or more commits in a repository.

Service Reference:

Examples:

Calling the batchGetCommits operation

var params = {
  commitIds: [ /* required */
    'STRING_VALUE',
    /* more items */
  ],
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.batchGetCommits(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • commitIds — (Array<String>)

      The full commit IDs of the commits to get information about.

      Note: You must supply the full SHA IDs of each commit. You cannot use shortened SHA IDs.
    • repositoryName — (String)

      The name of the repository that contains the commits.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commits — (Array<map>)

        An array of commit data type objects, each of which contains information about a specified commit.

        • commitId — (String)

          The full SHA ID of the specified commit.

        • treeId — (String)

          Tree information for the specified commit.

        • parents — (Array<String>)

          A list of parent commits for the specified commit. Each parent commit ID is the full commit ID.

        • message — (String)

          The commit message associated with the specified commit.

        • author — (map)

          Information about the author of the specified commit. Information includes the date in timestamp format with GMT offset, the name of the author, and the email address for the author, as configured in Git.

          • name — (String)

            The name of the user who made the specified commit.

          • email — (String)

            The email address associated with the user who made the commit, if any.

          • date — (String)

            The date when the specified commit was commited, in timestamp format with GMT offset.

        • committer — (map)

          Information about the person who committed the specified commit, also known as the committer. Information includes the date in timestamp format with GMT offset, the name of the committer, and the email address for the committer, as configured in Git.

          For more information about the difference between an author and a committer in Git, see Viewing the Commit History in Pro Git by Scott Chacon and Ben Straub.

          • name — (String)

            The name of the user who made the specified commit.

          • email — (String)

            The email address associated with the user who made the commit, if any.

          • date — (String)

            The date when the specified commit was commited, in timestamp format with GMT offset.

        • additionalData — (String)

          Any other data associated with the specified commit.

      • errors — (Array<map>)

        Returns any commit IDs for which information could not be found. For example, if one of the commit IDs was a shortened SHA ID or that commit was not found in the specified repository, the ID returns an error object with more information.

        • commitId — (String)

          A commit ID that either could not be found or was not in a valid format.

        • errorCode — (String)

          An error code that specifies whether the commit ID was not valid or not found.

        • errorMessage — (String)

          An error message that provides detail about why the commit ID either was not found or was not valid.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

batchGetRepositories(params = {}, callback) ⇒ AWS.Request

Returns information about one or more repositories.

Note: The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.

Service Reference:

Examples:

Calling the batchGetRepositories operation

var params = {
  repositoryNames: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
codecommit.batchGetRepositories(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryNames — (Array<String>)

      The names of the repositories to get information about.

      Note: The length constraint limit is for each string in the array. The array itself can be empty.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositories — (Array<map>)

        A list of repositories returned by the batch get repositories operation.

        • accountId — (String)

          The ID of the AWS account associated with the repository.

        • repositoryId — (String)

          The ID of the repository.

        • repositoryName — (String)

          The repository's name.

        • repositoryDescription — (String)

          A comment or description about the repository.

        • defaultBranch — (String)

          The repository's default branch name.

        • lastModifiedDate — (Date)

          The date and time the repository was last modified, in timestamp format.

        • creationDate — (Date)

          The date and time the repository was created, in timestamp format.

        • cloneUrlHttp — (String)

          The URL to use for cloning the repository over HTTPS.

        • cloneUrlSsh — (String)

          The URL to use for cloning the repository over SSH.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the repository.

      • repositoriesNotFound — (Array<String>)

        Returns a list of repository names for which information could not be found.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createApprovalRuleTemplate(params = {}, callback) ⇒ AWS.Request

Creates a template for approval rules that can then be associated with one or more repositories in your AWS account. When you associate a template with a repository, AWS CodeCommit creates an approval rule that matches the conditions of the template for all pull requests that meet the conditions of the template. For more information, see AssociateApprovalRuleTemplateWithRepository.

Service Reference:

Examples:

Calling the createApprovalRuleTemplate operation

var params = {
  approvalRuleTemplateContent: 'STRING_VALUE', /* required */
  approvalRuleTemplateName: 'STRING_VALUE', /* required */
  approvalRuleTemplateDescription: 'STRING_VALUE'
};
codecommit.createApprovalRuleTemplate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • approvalRuleTemplateName — (String)

      The name of the approval rule template. Provide descriptive names, because this name is applied to the approval rules created automatically in associated repositories.

    • approvalRuleTemplateContent — (String)

      The content of the approval rule that is created on pull requests in associated repositories. If you specify one or more destination references (branches), approval rules are created in an associated repository only if their destination references (branches) match those specified in the template.

      Note: When you create the content of the approval rule template, you can specify approvers in an approval pool in one of two ways:
      • CodeCommitApprovers: This option only requires an AWS account and a resource. It can be used for both IAM users and federated access users whose name matches the provided resource name. This is a very powerful option that offers a great deal of flexibility. For example, if you specify the AWS account 123456789012 and Mary_Major, all of the following are counted as approvals coming from that user:
        • An IAM user in the account (arn:aws:iam::123456789012:user/Mary_Major)
        • A federated user identified in IAM as Mary_Major (arn:aws:sts::123456789012:federated-user/Mary_Major)
        This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role session name of Mary_Major (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) unless you include a wildcard (*Mary_Major).
      • Fully qualified ARN: This option allows you to specify the fully qualified Amazon Resource Name (ARN) of the IAM user or role.
      For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in the IAM User Guide.
    • approvalRuleTemplateDescription — (String)

      The description of the approval rule template. Consider providing a description that explains what this template does and when it might be appropriate to associate it with repositories.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvalRuleTemplate — (map)

        The content and structure of the created approval rule template.

        • approvalRuleTemplateId — (String)

          The system-generated ID of the approval rule template.

        • approvalRuleTemplateName — (String)

          The name of the approval rule template.

        • approvalRuleTemplateDescription — (String)

          The description of the approval rule template.

        • approvalRuleTemplateContent — (String)

          The content of the approval rule template.

        • ruleContentSha256 — (String)

          The SHA-256 hash signature for the content of the approval rule template.

        • lastModifiedDate — (Date)

          The date the approval rule template was most recently changed, in timestamp format.

        • creationDate — (Date)

          The date the approval rule template was created, in timestamp format.

        • lastModifiedUser — (String)

          The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createBranch(params = {}, callback) ⇒ AWS.Request

Creates a branch in a repository and points the branch to a commit.

Note: Calling the create branch operation does not set a repository's default branch. To do this, call the update default branch operation.

Service Reference:

Examples:

Calling the createBranch operation

var params = {
  branchName: 'STRING_VALUE', /* required */
  commitId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.createBranch(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository in which you want to create the new branch.

    • branchName — (String)

      The name of the new branch to create.

    • commitId — (String)

      The ID of the commit to point the new branch to.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createCommit(params = {}, callback) ⇒ AWS.Request

Creates a commit for a repository on the tip of a specified branch.

Service Reference:

Examples:

Calling the createCommit operation

var params = {
  branchName: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  authorName: 'STRING_VALUE',
  commitMessage: 'STRING_VALUE',
  deleteFiles: [
    {
      filePath: 'STRING_VALUE' /* required */
    },
    /* more items */
  ],
  email: 'STRING_VALUE',
  keepEmptyFolders: true || false,
  parentCommitId: 'STRING_VALUE',
  putFiles: [
    {
      filePath: 'STRING_VALUE', /* required */
      fileContent: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
      fileMode: EXECUTABLE | NORMAL | SYMLINK,
      sourceFile: {
        filePath: 'STRING_VALUE', /* required */
        isMove: true || false
      }
    },
    /* more items */
  ],
  setFileModes: [
    {
      fileMode: EXECUTABLE | NORMAL | SYMLINK, /* required */
      filePath: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
codecommit.createCommit(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you create the commit.

    • branchName — (String)

      The name of the branch where you create the commit.

    • parentCommitId — (String)

      The ID of the commit that is the parent of the commit you create. Not required if this is an empty repository.

    • authorName — (String)

      The name of the author who created the commit. This information is used as both the author and committer for the commit.

    • email — (String)

      The email address of the person who created the commit.

    • commitMessage — (String)

      The commit message you want to include in the commit. Commit messages are limited to 256 KB. If no message is specified, a default message is used.

    • keepEmptyFolders — (Boolean)

      If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If true, a ..gitkeep file is created for empty folders. The default is false.

    • putFiles — (Array<map>)

      The files to add or update in this commit.

      • filePathrequired — (String)

        The full path to the file in the repository, including the name of the file.

      • fileMode — (String)

        The extrapolated file mode permissions for the file. Valid values include EXECUTABLE and NORMAL.

        Possible values include:
        • "EXECUTABLE"
        • "NORMAL"
        • "SYMLINK"
      • fileContent — (Buffer, Typed Array, Blob, String)

        The content of the file, if a source file is not specified.

      • sourceFile — (map)

        The name and full path of the file that contains the changes you want to make as part of the commit, if you are not providing the file content directly.

        • filePathrequired — (String)

          The full path to the file, including the name of the file.

        • isMove — (Boolean)

          Whether to remove the source file from the parent commit.

    • deleteFiles — (Array<map>)

      The files to delete in this commit. These files still exist in earlier commits.

      • filePathrequired — (String)

        The full path of the file to be deleted, including the name of the file.

    • setFileModes — (Array<map>)

      The file modes to update for files in this commit.

      • filePathrequired — (String)

        The full path to the file, including the name of the file.

      • fileModerequired — (String)

        The file mode for the file.

        Possible values include:
        • "EXECUTABLE"
        • "NORMAL"
        • "SYMLINK"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commitId — (String)

        The full commit ID of the commit that contains your committed file changes.

      • treeId — (String)

        The full SHA-1 pointer of the tree information for the commit that contains the commited file changes.

      • filesAdded — (Array<map>)

        The files added as part of the committed file changes.

        • absolutePath — (String)

          The full path to the file to be added or updated, including the name of the file.

        • blobId — (String)

          The blob ID that contains the file information.

        • fileMode — (String)

          The extrapolated file mode permissions for the file. Valid values include EXECUTABLE and NORMAL.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"
      • filesUpdated — (Array<map>)

        The files updated as part of the commited file changes.

        • absolutePath — (String)

          The full path to the file to be added or updated, including the name of the file.

        • blobId — (String)

          The blob ID that contains the file information.

        • fileMode — (String)

          The extrapolated file mode permissions for the file. Valid values include EXECUTABLE and NORMAL.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"
      • filesDeleted — (Array<map>)

        The files deleted as part of the committed file changes.

        • absolutePath — (String)

          The full path to the file to be added or updated, including the name of the file.

        • blobId — (String)

          The blob ID that contains the file information.

        • fileMode — (String)

          The extrapolated file mode permissions for the file. Valid values include EXECUTABLE and NORMAL.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createPullRequest(params = {}, callback) ⇒ AWS.Request

Creates a pull request in the specified repository.

Service Reference:

Examples:

Calling the createPullRequest operation

var params = {
  targets: [ /* required */
    {
      repositoryName: 'STRING_VALUE', /* required */
      sourceReference: 'STRING_VALUE', /* required */
      destinationReference: 'STRING_VALUE'
    },
    /* more items */
  ],
  title: 'STRING_VALUE', /* required */
  clientRequestToken: 'STRING_VALUE',
  description: 'STRING_VALUE'
};
codecommit.createPullRequest(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • title — (String)

      The title of the pull request. This title is used to identify the pull request to other users in the repository.

    • description — (String)

      A description of the pull request.

    • targets — (Array<map>)

      The targets for the pull request, including the source of the code to be reviewed (the source branch) and the destination where the creator of the pull request intends the code to be merged after the pull request is closed (the destination branch).

      • repositoryNamerequired — (String)

        The name of the repository that contains the pull request.

      • sourceReferencerequired — (String)

        The branch of the repository that contains the changes for the pull request. Also known as the source branch.

      • destinationReference — (String)

        The branch of the repository where the pull request changes are merged. Also known as the destination branch.

    • clientRequestToken — (String)

      A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

      Note: The AWS SDKs prepopulate client request tokens. If you are using an AWS SDK, an idempotency token is created for you.
      If a token is not provided, the SDK will use a version 4 UUID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • pullRequest — (map)

        Information about the newly created pull request.

        • pullRequestId — (String)

          The system-generated ID of the pull request.

        • title — (String)

          The user-defined title of the pull request. This title is displayed in the list of pull requests to other repository users.

        • description — (String)

          The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

        • lastActivityDate — (Date)

          The day and time of the last user or system activity on the pull request, in timestamp format.

        • creationDate — (Date)

          The date and time the pull request was originally created, in timestamp format.

        • pullRequestStatus — (String)

          The status of the pull request. Pull request status can only change from OPEN to CLOSED.

          Possible values include:
          • "OPEN"
          • "CLOSED"
        • authorArn — (String)

          The Amazon Resource Name (ARN) of the user who created the pull request.

        • pullRequestTargets — (Array<map>)

          The targets of the pull request, including the source branch and destination branch for the pull request.

          • repositoryName — (String)

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference — (String)

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference — (String)

            The branch of the repository where the pull request changes are merged. Also known as the destination branch.

          • destinationCommit — (String)

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit — (String)

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID changes to reflect the new tip of the branch.

          • mergeBase — (String)

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

          • mergeMetadata — (map)

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged — (Boolean)

              A Boolean value indicating whether the merge has been made.

            • mergedBy — (String)

              The Amazon Resource Name (ARN) of the user who merged the branches.

            • mergeCommitId — (String)

              The commit ID for the merge commit, if any.

            • mergeOption — (String)

              The merge strategy used in the merge.

              Possible values include:
              • "FAST_FORWARD_MERGE"
              • "SQUASH_MERGE"
              • "THREE_WAY_MERGE"
        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • revisionId — (String)

          The system-generated revision ID for the pull request.

        • approvalRules — (Array<map>)

          The approval rules applied to the pull request.

          • approvalRuleId — (String)

            The system-generated ID of the approval rule.

          • approvalRuleName — (String)

            The name of the approval rule.

          • approvalRuleContent — (String)

            The content of the approval rule.

          • ruleContentSha256 — (String)

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate — (Date)

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate — (Date)

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser — (String)

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate — (map)

            The approval rule template used to create the rule.

            • approvalRuleTemplateId — (String)

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName — (String)

              The name of the template that created the approval rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createPullRequestApprovalRule(params = {}, callback) ⇒ AWS.Request

Creates an approval rule for a pull request.

Service Reference:

Examples:

Calling the createPullRequestApprovalRule operation

var params = {
  approvalRuleContent: 'STRING_VALUE', /* required */
  approvalRuleName: 'STRING_VALUE', /* required */
  pullRequestId: 'STRING_VALUE' /* required */
};
codecommit.createPullRequestApprovalRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request for which you want to create the approval rule.

    • approvalRuleName — (String)

      The name for the approval rule.

    • approvalRuleContent — (String)

      The content of the approval rule, including the number of approvals needed and the structure of an approval pool defined for approvals, if any. For more information about approval pools, see the AWS CodeCommit User Guide.

      Note: When you create the content of the approval rule, you can specify approvers in an approval pool in one of two ways:
      • CodeCommitApprovers: This option only requires an AWS account and a resource. It can be used for both IAM users and federated access users whose name matches the provided resource name. This is a very powerful option that offers a great deal of flexibility. For example, if you specify the AWS account 123456789012 and Mary_Major, all of the following would be counted as approvals coming from that user:
        • An IAM user in the account (arn:aws:iam::123456789012:user/Mary_Major)
        • A federated user identified in IAM as Mary_Major (arn:aws:sts::123456789012:federated-user/Mary_Major)
        This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role session name of Mary_Major (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) unless you include a wildcard (*Mary_Major).
      • Fully qualified ARN: This option allows you to specify the fully qualified Amazon Resource Name (ARN) of the IAM user or role.
      For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in the IAM User Guide.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvalRule — (map)

        Information about the created approval rule.

        • approvalRuleId — (String)

          The system-generated ID of the approval rule.

        • approvalRuleName — (String)

          The name of the approval rule.

        • approvalRuleContent — (String)

          The content of the approval rule.

        • ruleContentSha256 — (String)

          The SHA-256 hash signature for the content of the approval rule.

        • lastModifiedDate — (Date)

          The date the approval rule was most recently changed, in timestamp format.

        • creationDate — (Date)

          The date the approval rule was created, in timestamp format.

        • lastModifiedUser — (String)

          The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

        • originApprovalRuleTemplate — (map)

          The approval rule template used to create the rule.

          • approvalRuleTemplateId — (String)

            The ID of the template that created the approval rule.

          • approvalRuleTemplateName — (String)

            The name of the template that created the approval rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createRepository(params = {}, callback) ⇒ AWS.Request

Creates a new, empty repository.

Service Reference:

Examples:

Calling the createRepository operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  repositoryDescription: 'STRING_VALUE',
  tags: {
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
codecommit.createRepository(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the new repository to be created.

      Note: The repository name must be unique across the calling AWS account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For more information about the limits on repository names, see Limits in the AWS CodeCommit User Guide. The suffix .git is prohibited.
    • repositoryDescription — (String)

      A comment or description about the new repository.

      Note: The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.
    • tags — (map<String>)

      One or more tag key-value pairs to use when tagging this repository.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositoryMetadata — (map)

        Information about the newly created repository.

        • accountId — (String)

          The ID of the AWS account associated with the repository.

        • repositoryId — (String)

          The ID of the repository.

        • repositoryName — (String)

          The repository's name.

        • repositoryDescription — (String)

          A comment or description about the repository.

        • defaultBranch — (String)

          The repository's default branch name.

        • lastModifiedDate — (Date)

          The date and time the repository was last modified, in timestamp format.

        • creationDate — (Date)

          The date and time the repository was created, in timestamp format.

        • cloneUrlHttp — (String)

          The URL to use for cloning the repository over HTTPS.

        • cloneUrlSsh — (String)

          The URL to use for cloning the repository over SSH.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the repository.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createUnreferencedMergeCommit(params = {}, callback) ⇒ AWS.Request

Creates an unreferenced commit that represents the result of merging two branches using a specified merge strategy. This can help you determine the outcome of a potential merge. This API cannot be used with the fast-forward merge strategy because that strategy does not create a merge commit.

Note: This unreferenced merge commit can only be accessed using the GetCommit API or through git commands such as git fetch. To retrieve this commit, you must specify its commit ID or otherwise reference it.

Service Reference:

Examples:

Calling the createUnreferencedMergeCommit operation

var params = {
  destinationCommitSpecifier: 'STRING_VALUE', /* required */
  mergeOption: FAST_FORWARD_MERGE | SQUASH_MERGE | THREE_WAY_MERGE, /* required */
  repositoryName: 'STRING_VALUE', /* required */
  sourceCommitSpecifier: 'STRING_VALUE', /* required */
  authorName: 'STRING_VALUE',
  commitMessage: 'STRING_VALUE',
  conflictDetailLevel: FILE_LEVEL | LINE_LEVEL,
  conflictResolution: {
    deleteFiles: [
      {
        filePath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ],
    replaceContents: [
      {
        filePath: 'STRING_VALUE', /* required */
        replacementType: KEEP_BASE | KEEP_SOURCE | KEEP_DESTINATION | USE_NEW_CONTENT, /* required */
        content: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        fileMode: EXECUTABLE | NORMAL | SYMLINK
      },
      /* more items */
    ],
    setFileModes: [
      {
        fileMode: EXECUTABLE | NORMAL | SYMLINK, /* required */
        filePath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ]
  },
  conflictResolutionStrategy: NONE | ACCEPT_SOURCE | ACCEPT_DESTINATION | AUTOMERGE,
  email: 'STRING_VALUE',
  keepEmptyFolders: true || false
};
codecommit.createUnreferencedMergeCommit(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to create the unreferenced merge commit.

    • sourceCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • destinationCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • mergeOption — (String)

      The merge option or strategy you want to use to merge the code.

      Possible values include:
      • "FAST_FORWARD_MERGE"
      • "SQUASH_MERGE"
      • "THREE_WAY_MERGE"
    • conflictDetailLevel — (String)

      The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

      Possible values include:
      • "FILE_LEVEL"
      • "LINE_LEVEL"
    • conflictResolutionStrategy — (String)

      Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

      Possible values include:
      • "NONE"
      • "ACCEPT_SOURCE"
      • "ACCEPT_DESTINATION"
      • "AUTOMERGE"
    • authorName — (String)

      The name of the author who created the unreferenced commit. This information is used as both the author and committer for the commit.

    • email — (String)

      The email address for the person who created the unreferenced commit.

    • commitMessage — (String)

      The commit message for the unreferenced commit.

    • keepEmptyFolders — (Boolean)

      If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If this is specified as true, a .gitkeep file is created for empty folders. The default is false.

    • conflictResolution — (map)

      If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.

      • replaceContents — (Array<map>)

        Files to have content replaced as part of the merge conflict resolution.

        • filePathrequired — (String)

          The path of the conflicting file.

        • replacementTyperequired — (String)

          The replacement type to use when determining how to resolve the conflict.

          Possible values include:
          • "KEEP_BASE"
          • "KEEP_SOURCE"
          • "KEEP_DESTINATION"
          • "USE_NEW_CONTENT"
        • content — (Buffer, Typed Array, Blob, String)

          The base-64 encoded content to use when the replacement type is USE_NEW_CONTENT.

        • fileMode — (String)

          The file mode to apply during conflict resoltion.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"
      • deleteFiles — (Array<map>)

        Files to be deleted as part of the merge conflict resolution.

        • filePathrequired — (String)

          The full path of the file to be deleted, including the name of the file.

      • setFileModes — (Array<map>)

        File modes that are set as part of the merge conflict resolution.

        • filePathrequired — (String)

          The full path to the file, including the name of the file.

        • fileModerequired — (String)

          The file mode for the file.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commitId — (String)

        The full commit ID of the commit that contains your merge results.

      • treeId — (String)

        The full SHA-1 pointer of the tree information for the commit that contains the merge results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteApprovalRuleTemplate(params = {}, callback) ⇒ AWS.Request

Deletes a specified approval rule template. Deleting a template does not remove approval rules on pull requests already created with the template.

Service Reference:

Examples:

Calling the deleteApprovalRuleTemplate operation

var params = {
  approvalRuleTemplateName: 'STRING_VALUE' /* required */
};
codecommit.deleteApprovalRuleTemplate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • approvalRuleTemplateName — (String)

      The name of the approval rule template to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvalRuleTemplateId — (String)

        The system-generated ID of the deleted approval rule template. If the template has been previously deleted, the only response is a 200 OK.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteBranch(params = {}, callback) ⇒ AWS.Request

Deletes a branch from a repository, unless that branch is the default branch for the repository.

Service Reference:

Examples:

Calling the deleteBranch operation

var params = {
  branchName: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.deleteBranch(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the branch to be deleted.

    • branchName — (String)

      The name of the branch to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • deletedBranch — (map)

        Information about the branch deleted by the operation, including the branch name and the commit ID that was the tip of the branch.

        • branchName — (String)

          The name of the branch.

        • commitId — (String)

          The ID of the last commit made to the branch.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteCommentContent(params = {}, callback) ⇒ AWS.Request

Deletes the content of a comment made on a change, file, or commit in a repository.

Service Reference:

Examples:

Calling the deleteCommentContent operation

var params = {
  commentId: 'STRING_VALUE' /* required */
};
codecommit.deleteCommentContent(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • comment — (map)

        Information about the comment you just deleted.

        • commentId — (String)

          The system-generated comment ID.

        • content — (String)

          The content of the comment.

        • inReplyTo — (String)

          The ID of the comment for which this comment is a reply, if any.

        • creationDate — (Date)

          The date and time the comment was created, in timestamp format.

        • lastModifiedDate — (Date)

          The date and time the comment was most recently modified, in timestamp format.

        • authorArn — (String)

          The Amazon Resource Name (ARN) of the person who posted the comment.

        • deleted — (Boolean)

          A Boolean value indicating whether the comment has been deleted.

        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • callerReactions — (Array<String>)

          The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.

        • reactionCounts — (map<Integer>)

          A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteFile(params = {}, callback) ⇒ AWS.Request

Deletes a specified file from a specified branch. A commit is created on the branch that contains the revision. The file still exists in the commits earlier to the commit that contains the deletion.

Service Reference:

Examples:

Calling the deleteFile operation

var params = {
  branchName: 'STRING_VALUE', /* required */
  filePath: 'STRING_VALUE', /* required */
  parentCommitId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  commitMessage: 'STRING_VALUE',
  email: 'STRING_VALUE',
  keepEmptyFolders: true || false,
  name: 'STRING_VALUE'
};
codecommit.deleteFile(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the file to delete.

    • branchName — (String)

      The name of the branch where the commit that deletes the file is made.

    • filePath — (String)

      The fully qualified path to the file that to be deleted, including the full name and extension of that file. For example, /examples/file.md is a fully qualified path to a file named file.md in a folder named examples.

    • parentCommitId — (String)

      The ID of the commit that is the tip of the branch where you want to create the commit that deletes the file. This must be the HEAD commit for the branch. The commit that deletes the file is created from this commit ID.

    • keepEmptyFolders — (Boolean)

      If a file is the only object in the folder or directory, specifies whether to delete the folder or directory that contains the file. By default, empty folders are deleted. This includes empty folders that are part of the directory structure. For example, if the path to a file is dir1/dir2/dir3/dir4, and dir2 and dir3 are empty, deleting the last file in dir4 also deletes the empty folders dir4, dir3, and dir2.

    • commitMessage — (String)

      The commit message you want to include as part of deleting the file. Commit messages are limited to 256 KB. If no message is specified, a default message is used.

    • name — (String)

      The name of the author of the commit that deletes the file. If no name is specified, the user's ARN is used as the author name and committer name.

    • email — (String)

      The email address for the commit that deletes the file. If no email address is specified, the email address is left blank.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commitId — (String)

        The full commit ID of the commit that contains the change that deletes the file.

      • blobId — (String)

        The blob ID removed from the tree as part of deleting the file.

      • treeId — (String)

        The full SHA-1 pointer of the tree information for the commit that contains the delete file change.

      • filePath — (String)

        The fully qualified path to the file to be deleted, including the full name and extension of that file.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deletePullRequestApprovalRule(params = {}, callback) ⇒ AWS.Request

Deletes an approval rule from a specified pull request. Approval rules can be deleted from a pull request only if the pull request is open, and if the approval rule was created specifically for a pull request and not generated from an approval rule template associated with the repository where the pull request was created. You cannot delete an approval rule from a merged or closed pull request.

Service Reference:

Examples:

Calling the deletePullRequestApprovalRule operation

var params = {
  approvalRuleName: 'STRING_VALUE', /* required */
  pullRequestId: 'STRING_VALUE' /* required */
};
codecommit.deletePullRequestApprovalRule(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request that contains the approval rule you want to delete.

    • approvalRuleName — (String)

      The name of the approval rule you want to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvalRuleId — (String)

        The ID of the deleted approval rule.

        Note: If the approval rule was deleted in an earlier API call, the response is 200 OK without content.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteRepository(params = {}, callback) ⇒ AWS.Request

Deletes a repository. If a specified repository was already deleted, a null repository ID is returned.

Deleting a repository also deletes all associated objects and metadata. After a repository is deleted, all future push calls to the deleted repository fail.

Service Reference:

Examples:

Calling the deleteRepository operation

var params = {
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.deleteRepository(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositoryId — (String)

        The ID of the repository that was deleted.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeMergeConflicts(params = {}, callback) ⇒ AWS.Request

Returns information about one or more merge conflicts in the attempted merge of two commit specifiers using the squash or three-way merge strategy. If the merge option for the attempted merge is specified as FAST_FORWARD_MERGE, an exception is thrown.

Service Reference:

Examples:

Calling the describeMergeConflicts operation

var params = {
  destinationCommitSpecifier: 'STRING_VALUE', /* required */
  filePath: 'STRING_VALUE', /* required */
  mergeOption: FAST_FORWARD_MERGE | SQUASH_MERGE | THREE_WAY_MERGE, /* required */
  repositoryName: 'STRING_VALUE', /* required */
  sourceCommitSpecifier: 'STRING_VALUE', /* required */
  conflictDetailLevel: FILE_LEVEL | LINE_LEVEL,
  conflictResolutionStrategy: NONE | ACCEPT_SOURCE | ACCEPT_DESTINATION | AUTOMERGE,
  maxMergeHunks: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
codecommit.describeMergeConflicts(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to get information about a merge conflict.

    • destinationCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • sourceCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • mergeOption — (String)

      The merge option or strategy you want to use to merge the code.

      Possible values include:
      • "FAST_FORWARD_MERGE"
      • "SQUASH_MERGE"
      • "THREE_WAY_MERGE"
    • maxMergeHunks — (Integer)

      The maximum number of merge hunks to include in the output.

    • filePath — (String)

      The path of the target files used to describe the conflicts.

    • conflictDetailLevel — (String)

      The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

      Possible values include:
      • "FILE_LEVEL"
      • "LINE_LEVEL"
    • conflictResolutionStrategy — (String)

      Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

      Possible values include:
      • "NONE"
      • "ACCEPT_SOURCE"
      • "ACCEPT_DESTINATION"
      • "AUTOMERGE"
    • nextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • conflictMetadata — (map)

        Contains metadata about the conflicts found in the merge.

        • filePath — (String)

          The path of the file that contains conflicts.

        • fileSizes — (map)

          The file sizes of the file in the source, destination, and base of the merge.

          • source — (Integer)

            The size of a file in the source of a merge or pull request.

          • destination — (Integer)

            The size of a file in the destination of a merge or pull request.

          • base — (Integer)

            The size of a file in the base of a merge or pull request.

        • fileModes — (map)

          The file modes of the file in the source, destination, and base of the merge.

          • source — (String)

            The file mode of a file in the source of a merge or pull request.

            Possible values include:
            • "EXECUTABLE"
            • "NORMAL"
            • "SYMLINK"
          • destination — (String)

            The file mode of a file in the destination of a merge or pull request.

            Possible values include:
            • "EXECUTABLE"
            • "NORMAL"
            • "SYMLINK"
          • base — (String)

            The file mode of a file in the base of a merge or pull request.

            Possible values include:
            • "EXECUTABLE"
            • "NORMAL"
            • "SYMLINK"
        • objectTypes — (map)

          Information about any object type conflicts in a merge operation.

          • source — (String)

            The type of the object in the source branch.

            Possible values include:
            • "FILE"
            • "DIRECTORY"
            • "GIT_LINK"
            • "SYMBOLIC_LINK"
          • destination — (String)

            The type of the object in the destination branch.

            Possible values include:
            • "FILE"
            • "DIRECTORY"
            • "GIT_LINK"
            • "SYMBOLIC_LINK"
          • base — (String)

            The type of the object in the base commit of the merge.

            Possible values include:
            • "FILE"
            • "DIRECTORY"
            • "GIT_LINK"
            • "SYMBOLIC_LINK"
        • numberOfConflicts — (Integer)

          The number of conflicts, including both hunk conflicts and metadata conflicts.

        • isBinaryFile — (map)

          A boolean value (true or false) indicating whether the file is binary or textual in the source, destination, and base of the merge.

          • source — (Boolean)

            The binary or non-binary status of file in the source of a merge or pull request.

          • destination — (Boolean)

            The binary or non-binary status of a file in the destination of a merge or pull request.

          • base — (Boolean)

            The binary or non-binary status of a file in the base of a merge or pull request.

        • contentConflict — (Boolean)

          A boolean value indicating whether there are conflicts in the content of a file.

        • fileModeConflict — (Boolean)

          A boolean value indicating whether there are conflicts in the file mode of a file.

        • objectTypeConflict — (Boolean)

          A boolean value (true or false) indicating whether there are conflicts between the branches in the object type of a file, folder, or submodule.

        • mergeOperations — (map)

          Whether an add, modify, or delete operation caused the conflict between the source and destination of the merge.

          • source — (String)

            The operation (add, modify, or delete) on a file in the source of a merge or pull request.

            Possible values include:
            • "A"
            • "M"
            • "D"
          • destination — (String)

            The operation on a file in the destination of a merge or pull request.

            Possible values include:
            • "A"
            • "M"
            • "D"
      • mergeHunks — (Array<map>)

        A list of merge hunks of the differences between the files or lines.

        • isConflict — (Boolean)

          A Boolean value indicating whether a combination of hunks contains a conflict. Conflicts occur when the same file or the same lines in a file were modified in both the source and destination of a merge or pull request. Valid values include true, false, and null. True when the hunk represents a conflict and one or more files contains a line conflict. File mode conflicts in a merge do not set this to true.

        • source — (map)

          Information about the merge hunk in the source of a merge or pull request.

          • startLine — (Integer)

            The start position of the hunk in the merge result.

          • endLine — (Integer)

            The end position of the hunk in the merge result.

          • hunkContent — (String)

            The base-64 encoded content of the hunk merged region that might contain a conflict.

        • destination — (map)

          Information about the merge hunk in the destination of a merge or pull request.

          • startLine — (Integer)

            The start position of the hunk in the merge result.

          • endLine — (Integer)

            The end position of the hunk in the merge result.

          • hunkContent — (String)

            The base-64 encoded content of the hunk merged region that might contain a conflict.

        • base — (map)

          Information about the merge hunk in the base of a merge or pull request.

          • startLine — (Integer)

            The start position of the hunk in the merge result.

          • endLine — (Integer)

            The end position of the hunk in the merge result.

          • hunkContent — (String)

            The base-64 encoded content of the hunk merged region that might contain a conflict.

      • nextToken — (String)

        An enumeration token that can be used in a request to return the next batch of the results.

      • destinationCommitId — (String)

        The commit ID of the destination commit specifier that was used in the merge evaluation.

      • sourceCommitId — (String)

        The commit ID of the source commit specifier that was used in the merge evaluation.

      • baseCommitId — (String)

        The commit ID of the merge base.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describePullRequestEvents(params = {}, callback) ⇒ AWS.Request

Returns information about one or more pull request events.

Service Reference:

Examples:

Calling the describePullRequestEvents operation

var params = {
  pullRequestId: 'STRING_VALUE', /* required */
  actorArn: 'STRING_VALUE',
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE',
  pullRequestEventType: PULL_REQUEST_CREATED | PULL_REQUEST_STATUS_CHANGED | PULL_REQUEST_SOURCE_REFERENCE_UPDATED | PULL_REQUEST_MERGE_STATE_CHANGED | PULL_REQUEST_APPROVAL_RULE_CREATED | PULL_REQUEST_APPROVAL_RULE_UPDATED | PULL_REQUEST_APPROVAL_RULE_DELETED | PULL_REQUEST_APPROVAL_RULE_OVERRIDDEN | PULL_REQUEST_APPROVAL_STATE_CHANGED
};
codecommit.describePullRequestEvents(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request. To get this ID, use ListPullRequests.

    • pullRequestEventType — (String)

      Optional. The pull request event type about which you want to return information.

      Possible values include:
      • "PULL_REQUEST_CREATED"
      • "PULL_REQUEST_STATUS_CHANGED"
      • "PULL_REQUEST_SOURCE_REFERENCE_UPDATED"
      • "PULL_REQUEST_MERGE_STATE_CHANGED"
      • "PULL_REQUEST_APPROVAL_RULE_CREATED"
      • "PULL_REQUEST_APPROVAL_RULE_UPDATED"
      • "PULL_REQUEST_APPROVAL_RULE_DELETED"
      • "PULL_REQUEST_APPROVAL_RULE_OVERRIDDEN"
      • "PULL_REQUEST_APPROVAL_STATE_CHANGED"
    • actorArn — (String)

      The Amazon Resource Name (ARN) of the user whose actions resulted in the event. Examples include updating the pull request with more commits or changing the status of a pull request.

    • nextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

    • maxResults — (Integer)

      A non-zero, non-negative integer used to limit the number of returned results. The default is 100 events, which is also the maximum number of events that can be returned in a result.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • pullRequestEvents — (Array<map>)

        Information about the pull request events.

        • pullRequestId — (String)

          The system-generated ID of the pull request.

        • eventDate — (Date)

          The day and time of the pull request event, in timestamp format.

        • pullRequestEventType — (String)

          The type of the pull request event (for example, a status change event (PULL_REQUEST_STATUS_CHANGED) or update event (PULL_REQUEST_SOURCE_REFERENCE_UPDATED)).

          Possible values include:
          • "PULL_REQUEST_CREATED"
          • "PULL_REQUEST_STATUS_CHANGED"
          • "PULL_REQUEST_SOURCE_REFERENCE_UPDATED"
          • "PULL_REQUEST_MERGE_STATE_CHANGED"
          • "PULL_REQUEST_APPROVAL_RULE_CREATED"
          • "PULL_REQUEST_APPROVAL_RULE_UPDATED"
          • "PULL_REQUEST_APPROVAL_RULE_DELETED"
          • "PULL_REQUEST_APPROVAL_RULE_OVERRIDDEN"
          • "PULL_REQUEST_APPROVAL_STATE_CHANGED"
        • actorArn — (String)

          The Amazon Resource Name (ARN) of the user whose actions resulted in the event. Examples include updating the pull request with more commits or changing the status of a pull request.

        • pullRequestCreatedEventMetadata — (map)

          Information about the source and destination branches for the pull request.

          • repositoryName — (String)

            The name of the repository where the pull request was created.

          • sourceCommitId — (String)

            The commit ID on the source branch used when the pull request was created.

          • destinationCommitId — (String)

            The commit ID of the tip of the branch specified as the destination branch when the pull request was created.

          • mergeBase — (String)

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

        • pullRequestStatusChangedEventMetadata — (map)

          Information about the change in status for the pull request event.

          • pullRequestStatus — (String)

            The changed status of the pull request.

            Possible values include:
            • "OPEN"
            • "CLOSED"
        • pullRequestSourceReferenceUpdatedEventMetadata — (map)

          Information about the updated source branch for the pull request event.

          • repositoryName — (String)

            The name of the repository where the pull request was updated.

          • beforeCommitId — (String)

            The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was updated.

          • afterCommitId — (String)

            The full commit ID of the commit in the source branch that was the tip of the branch at the time the pull request was updated.

          • mergeBase — (String)

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

        • pullRequestMergedStateChangedEventMetadata — (map)

          Information about the change in mergability state for the pull request event.

          • repositoryName — (String)

            The name of the repository where the pull request was created.

          • destinationReference — (String)

            The name of the branch that the pull request is merged into.

          • mergeMetadata — (map)

            Information about the merge state change event.

            • isMerged — (Boolean)

              A Boolean value indicating whether the merge has been made.

            • mergedBy — (String)

              The Amazon Resource Name (ARN) of the user who merged the branches.

            • mergeCommitId — (String)

              The commit ID for the merge commit, if any.

            • mergeOption — (String)

              The merge strategy used in the merge.

              Possible values include:
              • "FAST_FORWARD_MERGE"
              • "SQUASH_MERGE"
              • "THREE_WAY_MERGE"
        • approvalRuleEventMetadata — (map)

          Information about a pull request event.

          • approvalRuleName — (String)

            The name of the approval rule.

          • approvalRuleId — (String)

            The system-generated ID of the approval rule.

          • approvalRuleContent — (String)

            The content of the approval rule.

        • approvalStateChangedEventMetadata — (map)

          Information about an approval state change for a pull request.

          • revisionId — (String)

            The revision ID of the pull request when the approval state changed.

          • approvalStatus — (String)

            The approval status for the pull request.

            Possible values include:
            • "APPROVE"
            • "REVOKE"
        • approvalRuleOverriddenEventMetadata — (map)

          Information about an approval rule override event for a pull request.

          • revisionId — (String)

            The revision ID of the pull request when the override event occurred.

          • overrideStatus — (String)

            The status of the override event.

            Possible values include:
            • "OVERRIDE"
            • "REVOKE"
      • nextToken — (String)

        An enumeration token that can be used in a request to return the next batch of the results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

disassociateApprovalRuleTemplateFromRepository(params = {}, callback) ⇒ AWS.Request

Removes the association between a template and a repository so that approval rules based on the template are not automatically created when pull requests are created in the specified repository. This does not delete any approval rules previously created for pull requests through the template association.

Examples:

Calling the disassociateApprovalRuleTemplateFromRepository operation

var params = {
  approvalRuleTemplateName: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.disassociateApprovalRuleTemplateFromRepository(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • approvalRuleTemplateName — (String)

      The name of the approval rule template to disassociate from a specified repository.

    • repositoryName — (String)

      The name of the repository you want to disassociate from the template.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

evaluatePullRequestApprovalRules(params = {}, callback) ⇒ AWS.Request

Evaluates whether a pull request has met all the conditions specified in its associated approval rules.

Examples:

Calling the evaluatePullRequestApprovalRules operation

var params = {
  pullRequestId: 'STRING_VALUE', /* required */
  revisionId: 'STRING_VALUE' /* required */
};
codecommit.evaluatePullRequestApprovalRules(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request you want to evaluate.

    • revisionId — (String)

      The system-generated ID for the pull request revision. To retrieve the most recent revision ID for a pull request, use GetPullRequest.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • evaluation — (map)

        The result of the evaluation, including the names of the rules whose conditions have been met (if any), the names of the rules whose conditions have not been met (if any), whether the pull request is in the approved state, and whether the pull request approval rule has been set aside by an override.

        • approved — (Boolean)

          Whether the state of the pull request is approved.

        • overridden — (Boolean)

          Whether the approval rule requirements for the pull request have been overridden and no longer need to be met.

        • approvalRulesSatisfied — (Array<String>)

          The names of the approval rules that have had their conditions met.

        • approvalRulesNotSatisfied — (Array<String>)

          The names of the approval rules that have not had their conditions met.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getApprovalRuleTemplate(params = {}, callback) ⇒ AWS.Request

Returns information about a specified approval rule template.

Service Reference:

Examples:

Calling the getApprovalRuleTemplate operation

var params = {
  approvalRuleTemplateName: 'STRING_VALUE' /* required */
};
codecommit.getApprovalRuleTemplate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • approvalRuleTemplateName — (String)

      The name of the approval rule template for which you want to get information.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvalRuleTemplate — (map)

        The content and structure of the approval rule template.

        • approvalRuleTemplateId — (String)

          The system-generated ID of the approval rule template.

        • approvalRuleTemplateName — (String)

          The name of the approval rule template.

        • approvalRuleTemplateDescription — (String)

          The description of the approval rule template.

        • approvalRuleTemplateContent — (String)

          The content of the approval rule template.

        • ruleContentSha256 — (String)

          The SHA-256 hash signature for the content of the approval rule template.

        • lastModifiedDate — (Date)

          The date the approval rule template was most recently changed, in timestamp format.

        • creationDate — (Date)

          The date the approval rule template was created, in timestamp format.

        • lastModifiedUser — (String)

          The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBlob(params = {}, callback) ⇒ AWS.Request

Returns the base-64 encoded content of an individual blob in a repository.

Service Reference:

Examples:

Calling the getBlob operation

var params = {
  blobId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.getBlob(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the blob.

    • blobId — (String)

      The ID of the blob, which is its SHA-1 pointer.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • content — (Buffer(Node.js), Typed Array(Browser))

        The content of the blob, usually a file.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getBranch(params = {}, callback) ⇒ AWS.Request

Returns information about a repository branch, including its name and the last commit ID.

Service Reference:

Examples:

Calling the getBranch operation

var params = {
  branchName: 'STRING_VALUE',
  repositoryName: 'STRING_VALUE'
};
codecommit.getBranch(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the branch for which you want to retrieve information.

    • branchName — (String)

      The name of the branch for which you want to retrieve information.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • branch — (map)

        The name of the branch.

        • branchName — (String)

          The name of the branch.

        • commitId — (String)

          The ID of the last commit made to the branch.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getComment(params = {}, callback) ⇒ AWS.Request

Returns the content of a comment made on a change, file, or commit in a repository.

Note: Reaction counts might include numbers from user identities who were deleted after the reaction was made. For a count of reactions from active identities, use GetCommentReactions.

Service Reference:

Examples:

Calling the getComment operation

var params = {
  commentId: 'STRING_VALUE' /* required */
};
codecommit.getComment(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • comment — (map)

        The contents of the comment.

        • commentId — (String)

          The system-generated comment ID.

        • content — (String)

          The content of the comment.

        • inReplyTo — (String)

          The ID of the comment for which this comment is a reply, if any.

        • creationDate — (Date)

          The date and time the comment was created, in timestamp format.

        • lastModifiedDate — (Date)

          The date and time the comment was most recently modified, in timestamp format.

        • authorArn — (String)

          The Amazon Resource Name (ARN) of the person who posted the comment.

        • deleted — (Boolean)

          A Boolean value indicating whether the comment has been deleted.

        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • callerReactions — (Array<String>)

          The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.

        • reactionCounts — (map<Integer>)

          A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getCommentReactions(params = {}, callback) ⇒ AWS.Request

Returns information about reactions to a specified comment ID. Reactions from users who have been deleted will not be included in the count.

Service Reference:

Examples:

Calling the getCommentReactions operation

var params = {
  commentId: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE',
  reactionUserArn: 'STRING_VALUE'
};
codecommit.getCommentReactions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • commentId — (String)

      The ID of the comment for which you want to get reactions information.

    • reactionUserArn — (String)

      Optional. The Amazon Resource Name (ARN) of the user or identity for which you want to get reaction information.

    • nextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

    • maxResults — (Integer)

      A non-zero, non-negative integer used to limit the number of returned results. The default is the same as the allowed maximum, 1,000.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • reactionsForComment — (Array<map>)

        An array of reactions to the specified comment.

        • reaction — (map)

          The reaction for a specified comment.

          • emoji — (String)

            The Emoji Version 1.0 graphic of the reaction. These graphics are interpreted slightly differently on different operating systems.

          • shortCode — (String)

            The emoji short code for the reaction. Short codes are interpreted slightly differently on different operating systems.

          • unicode — (String)

            The Unicode codepoint for the reaction.

        • reactionUsers — (Array<String>)

          The Amazon Resource Names (ARNs) of users who have provided reactions to the comment.

        • reactionsFromDeletedUsersCount — (Integer)

          A numerical count of users who reacted with the specified emoji whose identities have been subsequently deleted from IAM. While these IAM users or roles no longer exist, the reactions might still appear in total reaction counts.

      • nextToken — (String)

        An enumeration token that can be used in a request to return the next batch of the results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getCommentsForComparedCommit(params = {}, callback) ⇒ AWS.Request

Returns information about comments made on the comparison between two commits.

Note: Reaction counts might include numbers from user identities who were deleted after the reaction was made. For a count of reactions from active identities, use GetCommentReactions.

Service Reference:

Examples:

Calling the getCommentsForComparedCommit operation

var params = {
  afterCommitId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  beforeCommitId: 'STRING_VALUE',
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
codecommit.getCommentsForComparedCommit(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to compare commits.

    • beforeCommitId — (String)

      To establish the directionality of the comparison, the full commit ID of the before commit.

    • afterCommitId — (String)

      To establish the directionality of the comparison, the full commit ID of the after commit.

    • nextToken — (String)

      An enumeration token that when provided in a request, returns the next batch of the results.

    • maxResults — (Integer)

      A non-zero, non-negative integer used to limit the number of returned results. The default is 100 comments, but you can configure up to 500.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commentsForComparedCommitData — (Array<map>)

        A list of comment objects on the compared commit.

        • repositoryName — (String)

          The name of the repository that contains the compared commits.

        • beforeCommitId — (String)

          The full commit ID of the commit used to establish the before of the comparison.

        • afterCommitId — (String)

          The full commit ID of the commit used to establish the after of the comparison.

        • beforeBlobId — (String)

          The full blob ID of the commit used to establish the before of the comparison.

        • afterBlobId — (String)

          The full blob ID of the commit used to establish the after of the comparison.

        • location — (map)

          Location information about the comment on the comparison, including the file name, line number, and whether the version of the file where the comment was made is BEFORE or AFTER.

          • filePath — (String)

            The name of the file being compared, including its extension and subdirectory, if any.

          • filePosition — (Integer)

            The position of a change in a compared file, in line number format.

          • relativeFileVersion — (String)

            In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.

            Possible values include:
            • "BEFORE"
            • "AFTER"
        • comments — (Array<map>)

          An array of comment objects. Each comment object contains information about a comment on the comparison between commits.

          • commentId — (String)

            The system-generated comment ID.

          • content — (String)

            The content of the comment.

          • inReplyTo — (String)

            The ID of the comment for which this comment is a reply, if any.

          • creationDate — (Date)

            The date and time the comment was created, in timestamp format.

          • lastModifiedDate — (Date)

            The date and time the comment was most recently modified, in timestamp format.

          • authorArn — (String)

            The Amazon Resource Name (ARN) of the person who posted the comment.

          • deleted — (Boolean)

            A Boolean value indicating whether the comment has been deleted.

          • clientRequestToken — (String)

            A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

          • callerReactions — (Array<String>)

            The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.

          • reactionCounts — (map<Integer>)

            A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.

      • nextToken — (String)

        An enumeration token that can be used in a request to return the next batch of the results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getCommentsForPullRequest(params = {}, callback) ⇒ AWS.Request

Returns comments made on a pull request.

Note: Reaction counts might include numbers from user identities who were deleted after the reaction was made. For a count of reactions from active identities, use GetCommentReactions.

Service Reference:

Examples:

Calling the getCommentsForPullRequest operation

var params = {
  pullRequestId: 'STRING_VALUE', /* required */
  afterCommitId: 'STRING_VALUE',
  beforeCommitId: 'STRING_VALUE',
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE',
  repositoryName: 'STRING_VALUE'
};
codecommit.getCommentsForPullRequest(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request. To get this ID, use ListPullRequests.

    • repositoryName — (String)

      The name of the repository that contains the pull request.

    • beforeCommitId — (String)

      The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was created.

    • afterCommitId — (String)

      The full commit ID of the commit in the source branch that was the tip of the branch at the time the comment was made.

    • nextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

    • maxResults — (Integer)

      A non-zero, non-negative integer used to limit the number of returned results. The default is 100 comments. You can return up to 500 comments with a single request.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commentsForPullRequestData — (Array<map>)

        An array of comment objects on the pull request.

        • pullRequestId — (String)

          The system-generated ID of the pull request.

        • repositoryName — (String)

          The name of the repository that contains the pull request.

        • beforeCommitId — (String)

          The full commit ID of the commit that was the tip of the destination branch when the pull request was created. This commit is superceded by the after commit in the source branch when and if you merge the source branch into the destination branch.

        • afterCommitId — (String)

          The full commit ID of the commit that was the tip of the source branch at the time the comment was made.

        • beforeBlobId — (String)

          The full blob ID of the file on which you want to comment on the destination commit.

        • afterBlobId — (String)

          The full blob ID of the file on which you want to comment on the source commit.

        • location — (map)

          Location information about the comment on the pull request, including the file name, line number, and whether the version of the file where the comment was made is BEFORE (destination branch) or AFTER (source branch).

          • filePath — (String)

            The name of the file being compared, including its extension and subdirectory, if any.

          • filePosition — (Integer)

            The position of a change in a compared file, in line number format.

          • relativeFileVersion — (String)

            In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.

            Possible values include:
            • "BEFORE"
            • "AFTER"
        • comments — (Array<map>)

          An array of comment objects. Each comment object contains information about a comment on the pull request.

          • commentId — (String)

            The system-generated comment ID.

          • content — (String)

            The content of the comment.

          • inReplyTo — (String)

            The ID of the comment for which this comment is a reply, if any.

          • creationDate — (Date)

            The date and time the comment was created, in timestamp format.

          • lastModifiedDate — (Date)

            The date and time the comment was most recently modified, in timestamp format.

          • authorArn — (String)

            The Amazon Resource Name (ARN) of the person who posted the comment.

          • deleted — (Boolean)

            A Boolean value indicating whether the comment has been deleted.

          • clientRequestToken — (String)

            A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

          • callerReactions — (Array<String>)

            The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.

          • reactionCounts — (map<Integer>)

            A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.

      • nextToken — (String)

        An enumeration token that can be used in a request to return the next batch of the results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getCommit(params = {}, callback) ⇒ AWS.Request

Returns information about a commit, including commit message and committer information.

Service Reference:

Examples:

Calling the getCommit operation

var params = {
  commitId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.getCommit(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository to which the commit was made.

    • commitId — (String)

      The commit ID. Commit IDs are the full SHA ID of the commit.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commit — (map)

        A commit data type object that contains information about the specified commit.

        • commitId — (String)

          The full SHA ID of the specified commit.

        • treeId — (String)

          Tree information for the specified commit.

        • parents — (Array<String>)

          A list of parent commits for the specified commit. Each parent commit ID is the full commit ID.

        • message — (String)

          The commit message associated with the specified commit.

        • author — (map)

          Information about the author of the specified commit. Information includes the date in timestamp format with GMT offset, the name of the author, and the email address for the author, as configured in Git.

          • name — (String)

            The name of the user who made the specified commit.

          • email — (String)

            The email address associated with the user who made the commit, if any.

          • date — (String)

            The date when the specified commit was commited, in timestamp format with GMT offset.

        • committer — (map)

          Information about the person who committed the specified commit, also known as the committer. Information includes the date in timestamp format with GMT offset, the name of the committer, and the email address for the committer, as configured in Git.

          For more information about the difference between an author and a committer in Git, see Viewing the Commit History in Pro Git by Scott Chacon and Ben Straub.

          • name — (String)

            The name of the user who made the specified commit.

          • email — (String)

            The email address associated with the user who made the commit, if any.

          • date — (String)

            The date when the specified commit was commited, in timestamp format with GMT offset.

        • additionalData — (String)

          Any other data associated with the specified commit.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getDifferences(params = {}, callback) ⇒ AWS.Request

Returns information about the differences in a valid commit specifier (such as a branch, tag, HEAD, commit ID, or other fully qualified reference). Results can be limited to a specified path.

Service Reference:

Examples:

Calling the getDifferences operation

var params = {
  afterCommitSpecifier: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  MaxResults: 'NUMBER_VALUE',
  NextToken: 'STRING_VALUE',
  afterPath: 'STRING_VALUE',
  beforeCommitSpecifier: 'STRING_VALUE',
  beforePath: 'STRING_VALUE'
};
codecommit.getDifferences(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to get differences.

    • beforeCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, the full commit ID). Optional. If not specified, all changes before the afterCommitSpecifier value are shown. If you do not use beforeCommitSpecifier in your request, consider limiting the results with maxResults.

    • afterCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit.

    • beforePath — (String)

      The file path in which to check for differences. Limits the results to this path. Can also be used to specify the previous name of a directory or folder. If beforePath and afterPath are not specified, differences are shown for all paths.

    • afterPath — (String)

      The file path in which to check differences. Limits the results to this path. Can also be used to specify the changed name of a directory or folder, if it has changed. If not specified, differences are shown for all paths.

    • MaxResults — (Integer)

      A non-zero, non-negative integer used to limit the number of returned results.

    • NextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • differences — (Array<map>)

        A data type object that contains information about the differences, including whether the difference is added, modified, or deleted (A, D, M).

        • beforeBlob — (map)

          Information about a beforeBlob data type object, including the ID, the file mode permission code, and the path.

          • blobId — (String)

            The full ID of the blob.

          • path — (String)

            The path to the blob and associated file name, if any.

          • mode — (String)

            The file mode permissions of the blob. File mode permission codes include:

            • 100644 indicates read/write

            • 100755 indicates read/write/execute

            • 160000 indicates a submodule

            • 120000 indicates a symlink

        • afterBlob — (map)

          Information about an afterBlob data type object, including the ID, the file mode permission code, and the path.

          • blobId — (String)

            The full ID of the blob.

          • path — (String)

            The path to the blob and associated file name, if any.

          • mode — (String)

            The file mode permissions of the blob. File mode permission codes include:

            • 100644 indicates read/write

            • 100755 indicates read/write/execute

            • 160000 indicates a submodule

            • 120000 indicates a symlink

        • changeType — (String)

          Whether the change type of the difference is an addition (A), deletion (D), or modification (M).

          Possible values include:
          • "A"
          • "M"
          • "D"
      • NextToken — (String)

        An enumeration token that can be used in a request to return the next batch of the results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getFile(params = {}, callback) ⇒ AWS.Request

Returns the base-64 encoded contents of a specified file and its metadata.

Service Reference:

Examples:

Calling the getFile operation

var params = {
  filePath: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  commitSpecifier: 'STRING_VALUE'
};
codecommit.getFile(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the file.

    • commitSpecifier — (String)

      The fully quaified reference that identifies the commit that contains the file. For example, you can specify a full commit ID, a tag, a branch name, or a reference such as refs/heads/master. If none is provided, the head commit is used.

    • filePath — (String)

      The fully qualified path to the file, including the full name and extension of the file. For example, /examples/file.md is the fully qualified path to a file named file.md in a folder named examples.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commitId — (String)

        The full commit ID of the commit that contains the content returned by GetFile.

      • blobId — (String)

        The blob ID of the object that represents the file content.

      • filePath — (String)

        The fully qualified path to the specified file. Returns the name and extension of the file.

      • fileMode — (String)

        The extrapolated file mode permissions of the blob. Valid values include strings such as EXECUTABLE and not numeric values.

        Note: The file mode permissions returned by this API are not the standard file mode permission values, such as 100644, but rather extrapolated values. See the supported return values.
        Possible values include:
        • "EXECUTABLE"
        • "NORMAL"
        • "SYMLINK"
      • fileSize — (Integer)

        The size of the contents of the file, in bytes.

      • fileContent — (Buffer(Node.js), Typed Array(Browser))

        The base-64 encoded binary data object that represents the content of the file.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getFolder(params = {}, callback) ⇒ AWS.Request

Returns the contents of a specified folder in a repository.

Service Reference:

Examples:

Calling the getFolder operation

var params = {
  folderPath: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  commitSpecifier: 'STRING_VALUE'
};
codecommit.getFolder(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository.

    • commitSpecifier — (String)

      A fully qualified reference used to identify a commit that contains the version of the folder's content to return. A fully qualified reference can be a commit ID, branch name, tag, or reference such as HEAD. If no specifier is provided, the folder content is returned as it exists in the HEAD commit.

    • folderPath — (String)

      The fully qualified path to the folder whose contents are returned, including the folder name. For example, /examples is a fully-qualified path to a folder named examples that was created off of the root directory (/) of a repository.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commitId — (String)

        The full commit ID used as a reference for the returned version of the folder content.

      • folderPath — (String)

        The fully qualified path of the folder whose contents are returned.

      • treeId — (String)

        The full SHA-1 pointer of the tree information for the commit that contains the folder.

      • subFolders — (Array<map>)

        The list of folders that exist under the specified folder, if any.

        • treeId — (String)

          The full SHA-1 pointer of the tree information for the commit that contains the folder.

        • absolutePath — (String)

          The fully qualified path of the folder in the repository.

        • relativePath — (String)

          The relative path of the specified folder from the folder where the query originated.

      • files — (Array<map>)

        The list of files in the specified folder, if any.

        • blobId — (String)

          The blob ID that contains the file information.

        • absolutePath — (String)

          The fully qualified path to the file in the repository.

        • relativePath — (String)

          The relative path of the file from the folder where the query originated.

        • fileMode — (String)

          The extrapolated file mode permissions for the file. Valid values include EXECUTABLE and NORMAL.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"
      • symbolicLinks — (Array<map>)

        The list of symbolic links to other files and folders in the specified folder, if any.

        • blobId — (String)

          The blob ID that contains the information about the symbolic link.

        • absolutePath — (String)

          The fully qualified path to the folder that contains the symbolic link.

        • relativePath — (String)

          The relative path of the symbolic link from the folder where the query originated.

        • fileMode — (String)

          The file mode permissions of the blob that cotains information about the symbolic link.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"
      • subModules — (Array<map>)

        The list of submodules in the specified folder, if any.

        • commitId — (String)

          The commit ID that contains the reference to the submodule.

        • absolutePath — (String)

          The fully qualified path to the folder that contains the reference to the submodule.

        • relativePath — (String)

          The relative path of the submodule from the folder where the query originated.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getMergeCommit(params = {}, callback) ⇒ AWS.Request

Returns information about a specified merge commit.

Service Reference:

Examples:

Calling the getMergeCommit operation

var params = {
  destinationCommitSpecifier: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  sourceCommitSpecifier: 'STRING_VALUE', /* required */
  conflictDetailLevel: FILE_LEVEL | LINE_LEVEL,
  conflictResolutionStrategy: NONE | ACCEPT_SOURCE | ACCEPT_DESTINATION | AUTOMERGE
};
codecommit.getMergeCommit(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the merge commit about which you want to get information.

    • sourceCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • destinationCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • conflictDetailLevel — (String)

      The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

      Possible values include:
      • "FILE_LEVEL"
      • "LINE_LEVEL"
    • conflictResolutionStrategy — (String)

      Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

      Possible values include:
      • "NONE"
      • "ACCEPT_SOURCE"
      • "ACCEPT_DESTINATION"
      • "AUTOMERGE"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • sourceCommitId — (String)

        The commit ID of the source commit specifier that was used in the merge evaluation.

      • destinationCommitId — (String)

        The commit ID of the destination commit specifier that was used in the merge evaluation.

      • baseCommitId — (String)

        The commit ID of the merge base.

      • mergedCommitId — (String)

        The commit ID for the merge commit created when the source branch was merged into the destination branch. If the fast-forward merge strategy was used, there is no merge commit.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getMergeConflicts(params = {}, callback) ⇒ AWS.Request

Returns information about merge conflicts between the before and after commit IDs for a pull request in a repository.

Service Reference:

Examples:

Calling the getMergeConflicts operation

var params = {
  destinationCommitSpecifier: 'STRING_VALUE', /* required */
  mergeOption: FAST_FORWARD_MERGE | SQUASH_MERGE | THREE_WAY_MERGE, /* required */
  repositoryName: 'STRING_VALUE', /* required */
  sourceCommitSpecifier: 'STRING_VALUE', /* required */
  conflictDetailLevel: FILE_LEVEL | LINE_LEVEL,
  conflictResolutionStrategy: NONE | ACCEPT_SOURCE | ACCEPT_DESTINATION | AUTOMERGE,
  maxConflictFiles: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
codecommit.getMergeConflicts(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where the pull request was created.

    • destinationCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • sourceCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • mergeOption — (String)

      The merge option or strategy you want to use to merge the code.

      Possible values include:
      • "FAST_FORWARD_MERGE"
      • "SQUASH_MERGE"
      • "THREE_WAY_MERGE"
    • conflictDetailLevel — (String)

      The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

      Possible values include:
      • "FILE_LEVEL"
      • "LINE_LEVEL"
    • maxConflictFiles — (Integer)

      The maximum number of files to include in the output.

    • conflictResolutionStrategy — (String)

      Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

      Possible values include:
      • "NONE"
      • "ACCEPT_SOURCE"
      • "ACCEPT_DESTINATION"
      • "AUTOMERGE"
    • nextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • mergeable — (Boolean)

        A Boolean value that indicates whether the code is mergeable by the specified merge option.

      • destinationCommitId — (String)

        The commit ID of the destination commit specifier that was used in the merge evaluation.

      • sourceCommitId — (String)

        The commit ID of the source commit specifier that was used in the merge evaluation.

      • baseCommitId — (String)

        The commit ID of the merge base.

      • conflictMetadataList — (Array<map>)

        A list of metadata for any conflicting files. If the specified merge strategy is FAST_FORWARD_MERGE, this list is always empty.

        • filePath — (String)

          The path of the file that contains conflicts.

        • fileSizes — (map)

          The file sizes of the file in the source, destination, and base of the merge.

          • source — (Integer)

            The size of a file in the source of a merge or pull request.

          • destination — (Integer)

            The size of a file in the destination of a merge or pull request.

          • base — (Integer)

            The size of a file in the base of a merge or pull request.

        • fileModes — (map)

          The file modes of the file in the source, destination, and base of the merge.

          • source — (String)

            The file mode of a file in the source of a merge or pull request.

            Possible values include:
            • "EXECUTABLE"
            • "NORMAL"
            • "SYMLINK"
          • destination — (String)

            The file mode of a file in the destination of a merge or pull request.

            Possible values include:
            • "EXECUTABLE"
            • "NORMAL"
            • "SYMLINK"
          • base — (String)

            The file mode of a file in the base of a merge or pull request.

            Possible values include:
            • "EXECUTABLE"
            • "NORMAL"
            • "SYMLINK"
        • objectTypes — (map)

          Information about any object type conflicts in a merge operation.

          • source — (String)

            The type of the object in the source branch.

            Possible values include:
            • "FILE"
            • "DIRECTORY"
            • "GIT_LINK"
            • "SYMBOLIC_LINK"
          • destination — (String)

            The type of the object in the destination branch.

            Possible values include:
            • "FILE"
            • "DIRECTORY"
            • "GIT_LINK"
            • "SYMBOLIC_LINK"
          • base — (String)

            The type of the object in the base commit of the merge.

            Possible values include:
            • "FILE"
            • "DIRECTORY"
            • "GIT_LINK"
            • "SYMBOLIC_LINK"
        • numberOfConflicts — (Integer)

          The number of conflicts, including both hunk conflicts and metadata conflicts.

        • isBinaryFile — (map)

          A boolean value (true or false) indicating whether the file is binary or textual in the source, destination, and base of the merge.

          • source — (Boolean)

            The binary or non-binary status of file in the source of a merge or pull request.

          • destination — (Boolean)

            The binary or non-binary status of a file in the destination of a merge or pull request.

          • base — (Boolean)

            The binary or non-binary status of a file in the base of a merge or pull request.

        • contentConflict — (Boolean)

          A boolean value indicating whether there are conflicts in the content of a file.

        • fileModeConflict — (Boolean)

          A boolean value indicating whether there are conflicts in the file mode of a file.

        • objectTypeConflict — (Boolean)

          A boolean value (true or false) indicating whether there are conflicts between the branches in the object type of a file, folder, or submodule.

        • mergeOperations — (map)

          Whether an add, modify, or delete operation caused the conflict between the source and destination of the merge.

          • source — (String)

            The operation (add, modify, or delete) on a file in the source of a merge or pull request.

            Possible values include:
            • "A"
            • "M"
            • "D"
          • destination — (String)

            The operation on a file in the destination of a merge or pull request.

            Possible values include:
            • "A"
            • "M"
            • "D"
      • nextToken — (String)

        An enumeration token that can be used in a request to return the next batch of the results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getMergeOptions(params = {}, callback) ⇒ AWS.Request

Returns information about the merge options available for merging two specified branches. For details about why a merge option is not available, use GetMergeConflicts or DescribeMergeConflicts.

Service Reference:

Examples:

Calling the getMergeOptions operation

var params = {
  destinationCommitSpecifier: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  sourceCommitSpecifier: 'STRING_VALUE', /* required */
  conflictDetailLevel: FILE_LEVEL | LINE_LEVEL,
  conflictResolutionStrategy: NONE | ACCEPT_SOURCE | ACCEPT_DESTINATION | AUTOMERGE
};
codecommit.getMergeOptions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the commits about which you want to get merge options.

    • sourceCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • destinationCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • conflictDetailLevel — (String)

      The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

      Possible values include:
      • "FILE_LEVEL"
      • "LINE_LEVEL"
    • conflictResolutionStrategy — (String)

      Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

      Possible values include:
      • "NONE"
      • "ACCEPT_SOURCE"
      • "ACCEPT_DESTINATION"
      • "AUTOMERGE"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • mergeOptions — (Array<String>)

        The merge option or strategy used to merge the code.

      • sourceCommitId — (String)

        The commit ID of the source commit specifier that was used in the merge evaluation.

      • destinationCommitId — (String)

        The commit ID of the destination commit specifier that was used in the merge evaluation.

      • baseCommitId — (String)

        The commit ID of the merge base.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getPullRequest(params = {}, callback) ⇒ AWS.Request

Gets information about a pull request in a specified repository.

Service Reference:

Examples:

Calling the getPullRequest operation

var params = {
  pullRequestId: 'STRING_VALUE' /* required */
};
codecommit.getPullRequest(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request. To get this ID, use ListPullRequests.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • pullRequest — (map)

        Information about the specified pull request.

        • pullRequestId — (String)

          The system-generated ID of the pull request.

        • title — (String)

          The user-defined title of the pull request. This title is displayed in the list of pull requests to other repository users.

        • description — (String)

          The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

        • lastActivityDate — (Date)

          The day and time of the last user or system activity on the pull request, in timestamp format.

        • creationDate — (Date)

          The date and time the pull request was originally created, in timestamp format.

        • pullRequestStatus — (String)

          The status of the pull request. Pull request status can only change from OPEN to CLOSED.

          Possible values include:
          • "OPEN"
          • "CLOSED"
        • authorArn — (String)

          The Amazon Resource Name (ARN) of the user who created the pull request.

        • pullRequestTargets — (Array<map>)

          The targets of the pull request, including the source branch and destination branch for the pull request.

          • repositoryName — (String)

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference — (String)

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference — (String)

            The branch of the repository where the pull request changes are merged. Also known as the destination branch.

          • destinationCommit — (String)

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit — (String)

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID changes to reflect the new tip of the branch.

          • mergeBase — (String)

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

          • mergeMetadata — (map)

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged — (Boolean)

              A Boolean value indicating whether the merge has been made.

            • mergedBy — (String)

              The Amazon Resource Name (ARN) of the user who merged the branches.

            • mergeCommitId — (String)

              The commit ID for the merge commit, if any.

            • mergeOption — (String)

              The merge strategy used in the merge.

              Possible values include:
              • "FAST_FORWARD_MERGE"
              • "SQUASH_MERGE"
              • "THREE_WAY_MERGE"
        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • revisionId — (String)

          The system-generated revision ID for the pull request.

        • approvalRules — (Array<map>)

          The approval rules applied to the pull request.

          • approvalRuleId — (String)

            The system-generated ID of the approval rule.

          • approvalRuleName — (String)

            The name of the approval rule.

          • approvalRuleContent — (String)

            The content of the approval rule.

          • ruleContentSha256 — (String)

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate — (Date)

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate — (Date)

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser — (String)

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate — (map)

            The approval rule template used to create the rule.

            • approvalRuleTemplateId — (String)

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName — (String)

              The name of the template that created the approval rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getPullRequestApprovalStates(params = {}, callback) ⇒ AWS.Request

Gets information about the approval states for a specified pull request. Approval states only apply to pull requests that have one or more approval rules applied to them.

Service Reference:

Examples:

Calling the getPullRequestApprovalStates operation

var params = {
  pullRequestId: 'STRING_VALUE', /* required */
  revisionId: 'STRING_VALUE' /* required */
};
codecommit.getPullRequestApprovalStates(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID for the pull request.

    • revisionId — (String)

      The system-generated ID for the pull request revision.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvals — (Array<map>)

        Information about users who have approved the pull request.

        • userArn — (String)

          The Amazon Resource Name (ARN) of the user.

        • approvalState — (String)

          The state of the approval, APPROVE or REVOKE. REVOKE states are not stored.

          Possible values include:
          • "APPROVE"
          • "REVOKE"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getPullRequestOverrideState(params = {}, callback) ⇒ AWS.Request

Returns information about whether approval rules have been set aside (overridden) for a pull request, and if so, the Amazon Resource Name (ARN) of the user or identity that overrode the rules and their requirements for the pull request.

Service Reference:

Examples:

Calling the getPullRequestOverrideState operation

var params = {
  pullRequestId: 'STRING_VALUE', /* required */
  revisionId: 'STRING_VALUE' /* required */
};
codecommit.getPullRequestOverrideState(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The ID of the pull request for which you want to get information about whether approval rules have been set aside (overridden).

    • revisionId — (String)

      The system-generated ID of the revision for the pull request. To retrieve the most recent revision ID, use GetPullRequest.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • overridden — (Boolean)

        A Boolean value that indicates whether a pull request has had its rules set aside (TRUE) or whether all approval rules still apply (FALSE).

      • overrider — (String)

        The Amazon Resource Name (ARN) of the user or identity that overrode the rules and their requirements for the pull request.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getRepository(params = {}, callback) ⇒ AWS.Request

Returns information about a repository.

Note: The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.

Service Reference:

Examples:

Calling the getRepository operation

var params = {
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.getRepository(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository to get information about.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositoryMetadata — (map)

        Information about the repository.

        • accountId — (String)

          The ID of the AWS account associated with the repository.

        • repositoryId — (String)

          The ID of the repository.

        • repositoryName — (String)

          The repository's name.

        • repositoryDescription — (String)

          A comment or description about the repository.

        • defaultBranch — (String)

          The repository's default branch name.

        • lastModifiedDate — (Date)

          The date and time the repository was last modified, in timestamp format.

        • creationDate — (Date)

          The date and time the repository was created, in timestamp format.

        • cloneUrlHttp — (String)

          The URL to use for cloning the repository over HTTPS.

        • cloneUrlSsh — (String)

          The URL to use for cloning the repository over SSH.

        • Arn — (String)

          The Amazon Resource Name (ARN) of the repository.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

getRepositoryTriggers(params = {}, callback) ⇒ AWS.Request

Gets information about triggers configured for a repository.

Service Reference:

Examples:

Calling the getRepositoryTriggers operation

var params = {
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.getRepositoryTriggers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository for which the trigger is configured.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • configurationId — (String)

        The system-generated unique ID for the trigger.

      • triggers — (Array<map>)

        The JSON block of configuration information for each trigger.

        • namerequired — (String)

          The name of the trigger.

        • destinationArnrequired — (String)

          The ARN of the resource that is the target for a trigger (for example, the ARN of a topic in Amazon SNS).

        • customData — (String)

          Any custom data associated with the trigger to be included in the information sent to the target of the trigger.

        • branches — (Array<String>)

          The branches to be included in the trigger configuration. If you specify an empty array, the trigger applies to all branches.

          Note: Although no content is required in the array, you must include the array itself.
        • eventsrequired — (Array<String>)

          The repository events that cause the trigger to run actions in another service, such as sending a notification through Amazon SNS.

          Note: The valid value "all" cannot be used with any other values.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listApprovalRuleTemplates(params = {}, callback) ⇒ AWS.Request

Lists all approval rule templates in the specified AWS Region in your AWS account. If an AWS Region is not specified, the AWS Region where you are signed in is used.

Service Reference:

Examples:

Calling the listApprovalRuleTemplates operation

var params = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
codecommit.listApprovalRuleTemplates(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • nextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

    • maxResults — (Integer)

      A non-zero, non-negative integer used to limit the number of returned results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvalRuleTemplateNames — (Array<String>)

        The names of all the approval rule templates found in the AWS Region for your AWS account.

      • nextToken — (String)

        An enumeration token that allows the operation to batch the next results of the operation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listAssociatedApprovalRuleTemplatesForRepository(params = {}, callback) ⇒ AWS.Request

Lists all approval rule templates that are associated with a specified repository.

Examples:

Calling the listAssociatedApprovalRuleTemplatesForRepository operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
codecommit.listAssociatedApprovalRuleTemplatesForRepository(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository for which you want to list all associated approval rule templates.

    • nextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

    • maxResults — (Integer)

      A non-zero, non-negative integer used to limit the number of returned results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvalRuleTemplateNames — (Array<String>)

        The names of all approval rule templates associated with the repository.

      • nextToken — (String)

        An enumeration token that allows the operation to batch the next results of the operation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listBranches(params = {}, callback) ⇒ AWS.Request

Gets information about one or more branches in a repository.

Service Reference:

Examples:

Calling the listBranches operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  nextToken: 'STRING_VALUE'
};
codecommit.listBranches(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository that contains the branches.

    • nextToken — (String)

      An enumeration token that allows the operation to batch the results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • branches — (Array<String>)

        The list of branch names.

      • nextToken — (String)

        An enumeration token that returns the batch of the results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listPullRequests(params = {}, callback) ⇒ AWS.Request

Returns a list of pull requests for a specified repository. The return list can be refined by pull request status or pull request author ARN.

Service Reference:

Examples:

Calling the listPullRequests operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  authorArn: 'STRING_VALUE',
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE',
  pullRequestStatus: OPEN | CLOSED
};
codecommit.listPullRequests(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository for which you want to list pull requests.

    • authorArn — (String)

      Optional. The Amazon Resource Name (ARN) of the user who created the pull request. If used, this filters the results to pull requests created by that user.

    • pullRequestStatus — (String)

      Optional. The status of the pull request. If used, this refines the results to the pull requests that match the specified status.

      Possible values include:
      • "OPEN"
      • "CLOSED"
    • nextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

    • maxResults — (Integer)

      A non-zero, non-negative integer used to limit the number of returned results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • pullRequestIds — (Array<String>)

        The system-generated IDs of the pull requests.

      • nextToken — (String)

        An enumeration token that allows the operation to batch the next results of the operation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listRepositories(params = {}, callback) ⇒ AWS.Request

Gets information about one or more repositories.

Service Reference:

Examples:

Calling the listRepositories operation

var params = {
  nextToken: 'STRING_VALUE',
  order: ascending | descending,
  sortBy: repositoryName | lastModifiedDate
};
codecommit.listRepositories(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • nextToken — (String)

      An enumeration token that allows the operation to batch the results of the operation. Batch sizes are 1,000 for list repository operations. When the client sends the token back to AWS CodeCommit, another page of 1,000 records is retrieved.

    • sortBy — (String)

      The criteria used to sort the results of a list repositories operation.

      Possible values include:
      • "repositoryName"
      • "lastModifiedDate"
    • order — (String)

      The order in which to sort the results of a list repositories operation.

      Possible values include:
      • "ascending"
      • "descending"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositories — (Array<map>)

        Lists the repositories called by the list repositories operation.

        • repositoryName — (String)

          The name associated with the repository.

        • repositoryId — (String)

          The ID associated with the repository.

      • nextToken — (String)

        An enumeration token that allows the operation to batch the results of the operation. Batch sizes are 1,000 for list repository operations. When the client sends the token back to AWS CodeCommit, another page of 1,000 records is retrieved.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listRepositoriesForApprovalRuleTemplate(params = {}, callback) ⇒ AWS.Request

Lists all repositories associated with the specified approval rule template.

Examples:

Calling the listRepositoriesForApprovalRuleTemplate operation

var params = {
  approvalRuleTemplateName: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
codecommit.listRepositoriesForApprovalRuleTemplate(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • approvalRuleTemplateName — (String)

      The name of the approval rule template for which you want to list repositories that are associated with that template.

    • nextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

    • maxResults — (Integer)

      A non-zero, non-negative integer used to limit the number of returned results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositoryNames — (Array<String>)

        A list of repository names that are associated with the specified approval rule template.

      • nextToken — (String)

        An enumeration token that allows the operation to batch the next results of the operation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTagsForResource(params = {}, callback) ⇒ AWS.Request

Gets information about AWS tags for a specified Amazon Resource Name (ARN) in AWS CodeCommit. For a list of valid resources in AWS CodeCommit, see CodeCommit Resources and Operations in the AWS CodeCommit User Guide.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  nextToken: 'STRING_VALUE'
};
codecommit.listTagsForResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • resourceArn — (String)

      The Amazon Resource Name (ARN) of the resource for which you want to get information about tags, if any.

    • nextToken — (String)

      An enumeration token that, when provided in a request, returns the next batch of the results.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • tags — (map<String>)

        A list of tag key and value pairs associated with the specified resource.

      • nextToken — (String)

        An enumeration token that allows the operation to batch the next results of the operation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

mergeBranchesByFastForward(params = {}, callback) ⇒ AWS.Request

Merges two branches using the fast-forward merge strategy.

Service Reference:

Examples:

Calling the mergeBranchesByFastForward operation

var params = {
  destinationCommitSpecifier: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  sourceCommitSpecifier: 'STRING_VALUE', /* required */
  targetBranch: 'STRING_VALUE'
};
codecommit.mergeBranchesByFastForward(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to merge two branches.

    • sourceCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • destinationCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • targetBranch — (String)

      The branch where the merge is applied.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commitId — (String)

        The commit ID of the merge in the destination or target branch.

      • treeId — (String)

        The tree ID of the merge in the destination or target branch.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

mergeBranchesBySquash(params = {}, callback) ⇒ AWS.Request

Merges two branches using the squash merge strategy.

Service Reference:

Examples:

Calling the mergeBranchesBySquash operation

var params = {
  destinationCommitSpecifier: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  sourceCommitSpecifier: 'STRING_VALUE', /* required */
  authorName: 'STRING_VALUE',
  commitMessage: 'STRING_VALUE',
  conflictDetailLevel: FILE_LEVEL | LINE_LEVEL,
  conflictResolution: {
    deleteFiles: [
      {
        filePath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ],
    replaceContents: [
      {
        filePath: 'STRING_VALUE', /* required */
        replacementType: KEEP_BASE | KEEP_SOURCE | KEEP_DESTINATION | USE_NEW_CONTENT, /* required */
        content: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        fileMode: EXECUTABLE | NORMAL | SYMLINK
      },
      /* more items */
    ],
    setFileModes: [
      {
        fileMode: EXECUTABLE | NORMAL | SYMLINK, /* required */
        filePath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ]
  },
  conflictResolutionStrategy: NONE | ACCEPT_SOURCE | ACCEPT_DESTINATION | AUTOMERGE,
  email: 'STRING_VALUE',
  keepEmptyFolders: true || false,
  targetBranch: 'STRING_VALUE'
};
codecommit.mergeBranchesBySquash(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to merge two branches.

    • sourceCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • destinationCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • targetBranch — (String)

      The branch where the merge is applied.

    • conflictDetailLevel — (String)

      The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

      Possible values include:
      • "FILE_LEVEL"
      • "LINE_LEVEL"
    • conflictResolutionStrategy — (String)

      Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

      Possible values include:
      • "NONE"
      • "ACCEPT_SOURCE"
      • "ACCEPT_DESTINATION"
      • "AUTOMERGE"
    • authorName — (String)

      The name of the author who created the commit. This information is used as both the author and committer for the commit.

    • email — (String)

      The email address of the person merging the branches. This information is used in the commit information for the merge.

    • commitMessage — (String)

      The commit message for the merge.

    • keepEmptyFolders — (Boolean)

      If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If this is specified as true, a .gitkeep file is created for empty folders. The default is false.

    • conflictResolution — (map)

      If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.

      • replaceContents — (Array<map>)

        Files to have content replaced as part of the merge conflict resolution.

        • filePathrequired — (String)

          The path of the conflicting file.

        • replacementTyperequired — (String)

          The replacement type to use when determining how to resolve the conflict.

          Possible values include:
          • "KEEP_BASE"
          • "KEEP_SOURCE"
          • "KEEP_DESTINATION"
          • "USE_NEW_CONTENT"
        • content — (Buffer, Typed Array, Blob, String)

          The base-64 encoded content to use when the replacement type is USE_NEW_CONTENT.

        • fileMode — (String)

          The file mode to apply during conflict resoltion.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"
      • deleteFiles — (Array<map>)

        Files to be deleted as part of the merge conflict resolution.

        • filePathrequired — (String)

          The full path of the file to be deleted, including the name of the file.

      • setFileModes — (Array<map>)

        File modes that are set as part of the merge conflict resolution.

        • filePathrequired — (String)

          The full path to the file, including the name of the file.

        • fileModerequired — (String)

          The file mode for the file.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commitId — (String)

        The commit ID of the merge in the destination or target branch.

      • treeId — (String)

        The tree ID of the merge in the destination or target branch.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

mergeBranchesByThreeWay(params = {}, callback) ⇒ AWS.Request

Merges two specified branches using the three-way merge strategy.

Service Reference:

Examples:

Calling the mergeBranchesByThreeWay operation

var params = {
  destinationCommitSpecifier: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  sourceCommitSpecifier: 'STRING_VALUE', /* required */
  authorName: 'STRING_VALUE',
  commitMessage: 'STRING_VALUE',
  conflictDetailLevel: FILE_LEVEL | LINE_LEVEL,
  conflictResolution: {
    deleteFiles: [
      {
        filePath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ],
    replaceContents: [
      {
        filePath: 'STRING_VALUE', /* required */
        replacementType: KEEP_BASE | KEEP_SOURCE | KEEP_DESTINATION | USE_NEW_CONTENT, /* required */
        content: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        fileMode: EXECUTABLE | NORMAL | SYMLINK
      },
      /* more items */
    ],
    setFileModes: [
      {
        fileMode: EXECUTABLE | NORMAL | SYMLINK, /* required */
        filePath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ]
  },
  conflictResolutionStrategy: NONE | ACCEPT_SOURCE | ACCEPT_DESTINATION | AUTOMERGE,
  email: 'STRING_VALUE',
  keepEmptyFolders: true || false,
  targetBranch: 'STRING_VALUE'
};
codecommit.mergeBranchesByThreeWay(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to merge two branches.

    • sourceCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • destinationCommitSpecifier — (String)

      The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).

    • targetBranch — (String)

      The branch where the merge is applied.

    • conflictDetailLevel — (String)

      The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

      Possible values include:
      • "FILE_LEVEL"
      • "LINE_LEVEL"
    • conflictResolutionStrategy — (String)

      Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

      Possible values include:
      • "NONE"
      • "ACCEPT_SOURCE"
      • "ACCEPT_DESTINATION"
      • "AUTOMERGE"
    • authorName — (String)

      The name of the author who created the commit. This information is used as both the author and committer for the commit.

    • email — (String)

      The email address of the person merging the branches. This information is used in the commit information for the merge.

    • commitMessage — (String)

      The commit message to include in the commit information for the merge.

    • keepEmptyFolders — (Boolean)

      If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If true, a .gitkeep file is created for empty folders. The default is false.

    • conflictResolution — (map)

      If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.

      • replaceContents — (Array<map>)

        Files to have content replaced as part of the merge conflict resolution.

        • filePathrequired — (String)

          The path of the conflicting file.

        • replacementTyperequired — (String)

          The replacement type to use when determining how to resolve the conflict.

          Possible values include:
          • "KEEP_BASE"
          • "KEEP_SOURCE"
          • "KEEP_DESTINATION"
          • "USE_NEW_CONTENT"
        • content — (Buffer, Typed Array, Blob, String)

          The base-64 encoded content to use when the replacement type is USE_NEW_CONTENT.

        • fileMode — (String)

          The file mode to apply during conflict resoltion.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"
      • deleteFiles — (Array<map>)

        Files to be deleted as part of the merge conflict resolution.

        • filePathrequired — (String)

          The full path of the file to be deleted, including the name of the file.

      • setFileModes — (Array<map>)

        File modes that are set as part of the merge conflict resolution.

        • filePathrequired — (String)

          The full path to the file, including the name of the file.

        • fileModerequired — (String)

          The file mode for the file.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commitId — (String)

        The commit ID of the merge in the destination or target branch.

      • treeId — (String)

        The tree ID of the merge in the destination or target branch.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

mergePullRequestByFastForward(params = {}, callback) ⇒ AWS.Request

Attempts to merge the source commit of a pull request into the specified destination branch for that pull request at the specified commit using the fast-forward merge strategy. If the merge is successful, it closes the pull request.

Service Reference:

Examples:

Calling the mergePullRequestByFastForward operation

var params = {
  pullRequestId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  sourceCommitId: 'STRING_VALUE'
};
codecommit.mergePullRequestByFastForward(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request. To get this ID, use ListPullRequests.

    • repositoryName — (String)

      The name of the repository where the pull request was created.

    • sourceCommitId — (String)

      The full commit ID of the original or updated commit in the pull request source branch. Pass this value if you want an exception thrown if the current commit ID of the tip of the source branch does not match this commit ID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • pullRequest — (map)

        Information about the specified pull request, including the merge.

        • pullRequestId — (String)

          The system-generated ID of the pull request.

        • title — (String)

          The user-defined title of the pull request. This title is displayed in the list of pull requests to other repository users.

        • description — (String)

          The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

        • lastActivityDate — (Date)

          The day and time of the last user or system activity on the pull request, in timestamp format.

        • creationDate — (Date)

          The date and time the pull request was originally created, in timestamp format.

        • pullRequestStatus — (String)

          The status of the pull request. Pull request status can only change from OPEN to CLOSED.

          Possible values include:
          • "OPEN"
          • "CLOSED"
        • authorArn — (String)

          The Amazon Resource Name (ARN) of the user who created the pull request.

        • pullRequestTargets — (Array<map>)

          The targets of the pull request, including the source branch and destination branch for the pull request.

          • repositoryName — (String)

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference — (String)

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference — (String)

            The branch of the repository where the pull request changes are merged. Also known as the destination branch.

          • destinationCommit — (String)

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit — (String)

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID changes to reflect the new tip of the branch.

          • mergeBase — (String)

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

          • mergeMetadata — (map)

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged — (Boolean)

              A Boolean value indicating whether the merge has been made.

            • mergedBy — (String)

              The Amazon Resource Name (ARN) of the user who merged the branches.

            • mergeCommitId — (String)

              The commit ID for the merge commit, if any.

            • mergeOption — (String)

              The merge strategy used in the merge.

              Possible values include:
              • "FAST_FORWARD_MERGE"
              • "SQUASH_MERGE"
              • "THREE_WAY_MERGE"
        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • revisionId — (String)

          The system-generated revision ID for the pull request.

        • approvalRules — (Array<map>)

          The approval rules applied to the pull request.

          • approvalRuleId — (String)

            The system-generated ID of the approval rule.

          • approvalRuleName — (String)

            The name of the approval rule.

          • approvalRuleContent — (String)

            The content of the approval rule.

          • ruleContentSha256 — (String)

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate — (Date)

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate — (Date)

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser — (String)

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate — (map)

            The approval rule template used to create the rule.

            • approvalRuleTemplateId — (String)

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName — (String)

              The name of the template that created the approval rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

mergePullRequestBySquash(params = {}, callback) ⇒ AWS.Request

Attempts to merge the source commit of a pull request into the specified destination branch for that pull request at the specified commit using the squash merge strategy. If the merge is successful, it closes the pull request.

Service Reference:

Examples:

Calling the mergePullRequestBySquash operation

var params = {
  pullRequestId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  authorName: 'STRING_VALUE',
  commitMessage: 'STRING_VALUE',
  conflictDetailLevel: FILE_LEVEL | LINE_LEVEL,
  conflictResolution: {
    deleteFiles: [
      {
        filePath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ],
    replaceContents: [
      {
        filePath: 'STRING_VALUE', /* required */
        replacementType: KEEP_BASE | KEEP_SOURCE | KEEP_DESTINATION | USE_NEW_CONTENT, /* required */
        content: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        fileMode: EXECUTABLE | NORMAL | SYMLINK
      },
      /* more items */
    ],
    setFileModes: [
      {
        fileMode: EXECUTABLE | NORMAL | SYMLINK, /* required */
        filePath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ]
  },
  conflictResolutionStrategy: NONE | ACCEPT_SOURCE | ACCEPT_DESTINATION | AUTOMERGE,
  email: 'STRING_VALUE',
  keepEmptyFolders: true || false,
  sourceCommitId: 'STRING_VALUE'
};
codecommit.mergePullRequestBySquash(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request. To get this ID, use ListPullRequests.

    • repositoryName — (String)

      The name of the repository where the pull request was created.

    • sourceCommitId — (String)

      The full commit ID of the original or updated commit in the pull request source branch. Pass this value if you want an exception thrown if the current commit ID of the tip of the source branch does not match this commit ID.

    • conflictDetailLevel — (String)

      The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

      Possible values include:
      • "FILE_LEVEL"
      • "LINE_LEVEL"
    • conflictResolutionStrategy — (String)

      Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

      Possible values include:
      • "NONE"
      • "ACCEPT_SOURCE"
      • "ACCEPT_DESTINATION"
      • "AUTOMERGE"
    • commitMessage — (String)

      The commit message to include in the commit information for the merge.

    • authorName — (String)

      The name of the author who created the commit. This information is used as both the author and committer for the commit.

    • email — (String)

      The email address of the person merging the branches. This information is used in the commit information for the merge.

    • keepEmptyFolders — (Boolean)

      If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If true, a .gitkeep file is created for empty folders. The default is false.

    • conflictResolution — (map)

      If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.

      • replaceContents — (Array<map>)

        Files to have content replaced as part of the merge conflict resolution.

        • filePathrequired — (String)

          The path of the conflicting file.

        • replacementTyperequired — (String)

          The replacement type to use when determining how to resolve the conflict.

          Possible values include:
          • "KEEP_BASE"
          • "KEEP_SOURCE"
          • "KEEP_DESTINATION"
          • "USE_NEW_CONTENT"
        • content — (Buffer, Typed Array, Blob, String)

          The base-64 encoded content to use when the replacement type is USE_NEW_CONTENT.

        • fileMode — (String)

          The file mode to apply during conflict resoltion.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"
      • deleteFiles — (Array<map>)

        Files to be deleted as part of the merge conflict resolution.

        • filePathrequired — (String)

          The full path of the file to be deleted, including the name of the file.

      • setFileModes — (Array<map>)

        File modes that are set as part of the merge conflict resolution.

        • filePathrequired — (String)

          The full path to the file, including the name of the file.

        • fileModerequired — (String)

          The file mode for the file.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • pullRequest — (map)

        Returns information about a pull request.

        • pullRequestId — (String)

          The system-generated ID of the pull request.

        • title — (String)

          The user-defined title of the pull request. This title is displayed in the list of pull requests to other repository users.

        • description — (String)

          The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

        • lastActivityDate — (Date)

          The day and time of the last user or system activity on the pull request, in timestamp format.

        • creationDate — (Date)

          The date and time the pull request was originally created, in timestamp format.

        • pullRequestStatus — (String)

          The status of the pull request. Pull request status can only change from OPEN to CLOSED.

          Possible values include:
          • "OPEN"
          • "CLOSED"
        • authorArn — (String)

          The Amazon Resource Name (ARN) of the user who created the pull request.

        • pullRequestTargets — (Array<map>)

          The targets of the pull request, including the source branch and destination branch for the pull request.

          • repositoryName — (String)

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference — (String)

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference — (String)

            The branch of the repository where the pull request changes are merged. Also known as the destination branch.

          • destinationCommit — (String)

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit — (String)

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID changes to reflect the new tip of the branch.

          • mergeBase — (String)

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

          • mergeMetadata — (map)

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged — (Boolean)

              A Boolean value indicating whether the merge has been made.

            • mergedBy — (String)

              The Amazon Resource Name (ARN) of the user who merged the branches.

            • mergeCommitId — (String)

              The commit ID for the merge commit, if any.

            • mergeOption — (String)

              The merge strategy used in the merge.

              Possible values include:
              • "FAST_FORWARD_MERGE"
              • "SQUASH_MERGE"
              • "THREE_WAY_MERGE"
        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • revisionId — (String)

          The system-generated revision ID for the pull request.

        • approvalRules — (Array<map>)

          The approval rules applied to the pull request.

          • approvalRuleId — (String)

            The system-generated ID of the approval rule.

          • approvalRuleName — (String)

            The name of the approval rule.

          • approvalRuleContent — (String)

            The content of the approval rule.

          • ruleContentSha256 — (String)

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate — (Date)

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate — (Date)

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser — (String)

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate — (map)

            The approval rule template used to create the rule.

            • approvalRuleTemplateId — (String)

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName — (String)

              The name of the template that created the approval rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

mergePullRequestByThreeWay(params = {}, callback) ⇒ AWS.Request

Attempts to merge the source commit of a pull request into the specified destination branch for that pull request at the specified commit using the three-way merge strategy. If the merge is successful, it closes the pull request.

Service Reference:

Examples:

Calling the mergePullRequestByThreeWay operation

var params = {
  pullRequestId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  authorName: 'STRING_VALUE',
  commitMessage: 'STRING_VALUE',
  conflictDetailLevel: FILE_LEVEL | LINE_LEVEL,
  conflictResolution: {
    deleteFiles: [
      {
        filePath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ],
    replaceContents: [
      {
        filePath: 'STRING_VALUE', /* required */
        replacementType: KEEP_BASE | KEEP_SOURCE | KEEP_DESTINATION | USE_NEW_CONTENT, /* required */
        content: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */,
        fileMode: EXECUTABLE | NORMAL | SYMLINK
      },
      /* more items */
    ],
    setFileModes: [
      {
        fileMode: EXECUTABLE | NORMAL | SYMLINK, /* required */
        filePath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ]
  },
  conflictResolutionStrategy: NONE | ACCEPT_SOURCE | ACCEPT_DESTINATION | AUTOMERGE,
  email: 'STRING_VALUE',
  keepEmptyFolders: true || false,
  sourceCommitId: 'STRING_VALUE'
};
codecommit.mergePullRequestByThreeWay(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request. To get this ID, use ListPullRequests.

    • repositoryName — (String)

      The name of the repository where the pull request was created.

    • sourceCommitId — (String)

      The full commit ID of the original or updated commit in the pull request source branch. Pass this value if you want an exception thrown if the current commit ID of the tip of the source branch does not match this commit ID.

    • conflictDetailLevel — (String)

      The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.

      Possible values include:
      • "FILE_LEVEL"
      • "LINE_LEVEL"
    • conflictResolutionStrategy — (String)

      Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.

      Possible values include:
      • "NONE"
      • "ACCEPT_SOURCE"
      • "ACCEPT_DESTINATION"
      • "AUTOMERGE"
    • commitMessage — (String)

      The commit message to include in the commit information for the merge.

    • authorName — (String)

      The name of the author who created the commit. This information is used as both the author and committer for the commit.

    • email — (String)

      The email address of the person merging the branches. This information is used in the commit information for the merge.

    • keepEmptyFolders — (Boolean)

      If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If true, a .gitkeep file is created for empty folders. The default is false.

    • conflictResolution — (map)

      If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.

      • replaceContents — (Array<map>)

        Files to have content replaced as part of the merge conflict resolution.

        • filePathrequired — (String)

          The path of the conflicting file.

        • replacementTyperequired — (String)

          The replacement type to use when determining how to resolve the conflict.

          Possible values include:
          • "KEEP_BASE"
          • "KEEP_SOURCE"
          • "KEEP_DESTINATION"
          • "USE_NEW_CONTENT"
        • content — (Buffer, Typed Array, Blob, String)

          The base-64 encoded content to use when the replacement type is USE_NEW_CONTENT.

        • fileMode — (String)

          The file mode to apply during conflict resoltion.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"
      • deleteFiles — (Array<map>)

        Files to be deleted as part of the merge conflict resolution.

        • filePathrequired — (String)

          The full path of the file to be deleted, including the name of the file.

      • setFileModes — (Array<map>)

        File modes that are set as part of the merge conflict resolution.

        • filePathrequired — (String)

          The full path to the file, including the name of the file.

        • fileModerequired — (String)

          The file mode for the file.

          Possible values include:
          • "EXECUTABLE"
          • "NORMAL"
          • "SYMLINK"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • pullRequest — (map)

        Returns information about a pull request.

        • pullRequestId — (String)

          The system-generated ID of the pull request.

        • title — (String)

          The user-defined title of the pull request. This title is displayed in the list of pull requests to other repository users.

        • description — (String)

          The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

        • lastActivityDate — (Date)

          The day and time of the last user or system activity on the pull request, in timestamp format.

        • creationDate — (Date)

          The date and time the pull request was originally created, in timestamp format.

        • pullRequestStatus — (String)

          The status of the pull request. Pull request status can only change from OPEN to CLOSED.

          Possible values include:
          • "OPEN"
          • "CLOSED"
        • authorArn — (String)

          The Amazon Resource Name (ARN) of the user who created the pull request.

        • pullRequestTargets — (Array<map>)

          The targets of the pull request, including the source branch and destination branch for the pull request.

          • repositoryName — (String)

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference — (String)

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference — (String)

            The branch of the repository where the pull request changes are merged. Also known as the destination branch.

          • destinationCommit — (String)

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit — (String)

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID changes to reflect the new tip of the branch.

          • mergeBase — (String)

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

          • mergeMetadata — (map)

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged — (Boolean)

              A Boolean value indicating whether the merge has been made.

            • mergedBy — (String)

              The Amazon Resource Name (ARN) of the user who merged the branches.

            • mergeCommitId — (String)

              The commit ID for the merge commit, if any.

            • mergeOption — (String)

              The merge strategy used in the merge.

              Possible values include:
              • "FAST_FORWARD_MERGE"
              • "SQUASH_MERGE"
              • "THREE_WAY_MERGE"
        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • revisionId — (String)

          The system-generated revision ID for the pull request.

        • approvalRules — (Array<map>)

          The approval rules applied to the pull request.

          • approvalRuleId — (String)

            The system-generated ID of the approval rule.

          • approvalRuleName — (String)

            The name of the approval rule.

          • approvalRuleContent — (String)

            The content of the approval rule.

          • ruleContentSha256 — (String)

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate — (Date)

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate — (Date)

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser — (String)

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate — (map)

            The approval rule template used to create the rule.

            • approvalRuleTemplateId — (String)

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName — (String)

              The name of the template that created the approval rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

overridePullRequestApprovalRules(params = {}, callback) ⇒ AWS.Request

Sets aside (overrides) all approval rule requirements for a specified pull request.

Examples:

Calling the overridePullRequestApprovalRules operation

var params = {
  overrideStatus: OVERRIDE | REVOKE, /* required */
  pullRequestId: 'STRING_VALUE', /* required */
  revisionId: 'STRING_VALUE' /* required */
};
codecommit.overridePullRequestApprovalRules(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request for which you want to override all approval rule requirements. To get this information, use GetPullRequest.

    • revisionId — (String)

      The system-generated ID of the most recent revision of the pull request. You cannot override approval rules for anything but the most recent revision of a pull request. To get the revision ID, use GetPullRequest.

    • overrideStatus — (String)

      Whether you want to set aside approval rule requirements for the pull request (OVERRIDE) or revoke a previous override and apply approval rule requirements (REVOKE). REVOKE status is not stored.

      Possible values include:
      • "OVERRIDE"
      • "REVOKE"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

postCommentForComparedCommit(params = {}, callback) ⇒ AWS.Request

Posts a comment on the comparison between two commits.

Service Reference:

Examples:

Calling the postCommentForComparedCommit operation

var params = {
  afterCommitId: 'STRING_VALUE', /* required */
  content: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  beforeCommitId: 'STRING_VALUE',
  clientRequestToken: 'STRING_VALUE',
  location: {
    filePath: 'STRING_VALUE',
    filePosition: 'NUMBER_VALUE',
    relativeFileVersion: BEFORE | AFTER
  }
};
codecommit.postCommentForComparedCommit(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to post a comment on the comparison between commits.

    • beforeCommitId — (String)

      To establish the directionality of the comparison, the full commit ID of the before commit. Required for commenting on any commit unless that commit is the initial commit.

    • afterCommitId — (String)

      To establish the directionality of the comparison, the full commit ID of the after commit.

    • location — (map)

      The location of the comparison where you want to comment.

      • filePath — (String)

        The name of the file being compared, including its extension and subdirectory, if any.

      • filePosition — (Integer)

        The position of a change in a compared file, in line number format.

      • relativeFileVersion — (String)

        In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.

        Possible values include:
        • "BEFORE"
        • "AFTER"
    • content — (String)

      The content of the comment you want to make.

    • clientRequestToken — (String)

      A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

      If a token is not provided, the SDK will use a version 4 UUID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositoryName — (String)

        The name of the repository where you posted a comment on the comparison between commits.

      • beforeCommitId — (String)

        In the directionality you established, the full commit ID of the before commit.

      • afterCommitId — (String)

        In the directionality you established, the full commit ID of the after commit.

      • beforeBlobId — (String)

        In the directionality you established, the blob ID of the before blob.

      • afterBlobId — (String)

        In the directionality you established, the blob ID of the after blob.

      • location — (map)

        The location of the comment in the comparison between the two commits.

        • filePath — (String)

          The name of the file being compared, including its extension and subdirectory, if any.

        • filePosition — (Integer)

          The position of a change in a compared file, in line number format.

        • relativeFileVersion — (String)

          In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.

          Possible values include:
          • "BEFORE"
          • "AFTER"
      • comment — (map)

        The content of the comment you posted.

        • commentId — (String)

          The system-generated comment ID.

        • content — (String)

          The content of the comment.

        • inReplyTo — (String)

          The ID of the comment for which this comment is a reply, if any.

        • creationDate — (Date)

          The date and time the comment was created, in timestamp format.

        • lastModifiedDate — (Date)

          The date and time the comment was most recently modified, in timestamp format.

        • authorArn — (String)

          The Amazon Resource Name (ARN) of the person who posted the comment.

        • deleted — (Boolean)

          A Boolean value indicating whether the comment has been deleted.

        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • callerReactions — (Array<String>)

          The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.

        • reactionCounts — (map<Integer>)

          A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

postCommentForPullRequest(params = {}, callback) ⇒ AWS.Request

Posts a comment on a pull request.

Service Reference:

Examples:

Calling the postCommentForPullRequest operation

var params = {
  afterCommitId: 'STRING_VALUE', /* required */
  beforeCommitId: 'STRING_VALUE', /* required */
  content: 'STRING_VALUE', /* required */
  pullRequestId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  clientRequestToken: 'STRING_VALUE',
  location: {
    filePath: 'STRING_VALUE',
    filePosition: 'NUMBER_VALUE',
    relativeFileVersion: BEFORE | AFTER
  }
};
codecommit.postCommentForPullRequest(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request. To get this ID, use ListPullRequests.

    • repositoryName — (String)

      The name of the repository where you want to post a comment on a pull request.

    • beforeCommitId — (String)

      The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was created.

    • afterCommitId — (String)

      The full commit ID of the commit in the source branch that is the current tip of the branch for the pull request when you post the comment.

    • location — (map)

      The location of the change where you want to post your comment. If no location is provided, the comment is posted as a general comment on the pull request difference between the before commit ID and the after commit ID.

      • filePath — (String)

        The name of the file being compared, including its extension and subdirectory, if any.

      • filePosition — (Integer)

        The position of a change in a compared file, in line number format.

      • relativeFileVersion — (String)

        In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.

        Possible values include:
        • "BEFORE"
        • "AFTER"
    • content — (String)

      The content of your comment on the change.

    • clientRequestToken — (String)

      A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

      If a token is not provided, the SDK will use a version 4 UUID.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • repositoryName — (String)

        The name of the repository where you posted a comment on a pull request.

      • pullRequestId — (String)

        The system-generated ID of the pull request.

      • beforeCommitId — (String)

        The full commit ID of the commit in the source branch used to create the pull request, or in the case of an updated pull request, the full commit ID of the commit used to update the pull request.

      • afterCommitId — (String)

        The full commit ID of the commit in the destination branch where the pull request is merged.

      • beforeBlobId — (String)

        In the directionality of the pull request, the blob ID of the before blob.

      • afterBlobId — (String)

        In the directionality of the pull request, the blob ID of the after blob.

      • location — (map)

        The location of the change where you posted your comment.

        • filePath — (String)

          The name of the file being compared, including its extension and subdirectory, if any.

        • filePosition — (Integer)

          The position of a change in a compared file, in line number format.

        • relativeFileVersion — (String)

          In a comparison of commits or a pull request, whether the change is in the before or after of that comparison.

          Possible values include:
          • "BEFORE"
          • "AFTER"
      • comment — (map)

        The content of the comment you posted.

        • commentId — (String)

          The system-generated comment ID.

        • content — (String)

          The content of the comment.

        • inReplyTo — (String)

          The ID of the comment for which this comment is a reply, if any.

        • creationDate — (Date)

          The date and time the comment was created, in timestamp format.

        • lastModifiedDate — (Date)

          The date and time the comment was most recently modified, in timestamp format.

        • authorArn — (String)

          The Amazon Resource Name (ARN) of the person who posted the comment.

        • deleted — (Boolean)

          A Boolean value indicating whether the comment has been deleted.

        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • callerReactions — (Array<String>)

          The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.

        • reactionCounts — (map<Integer>)

          A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

postCommentReply(params = {}, callback) ⇒ AWS.Request

Posts a comment in reply to an existing comment on a comparison between commits or a pull request.

Service Reference:

Examples:

Calling the postCommentReply operation

var params = {
  content: 'STRING_VALUE', /* required */
  inReplyTo: 'STRING_VALUE', /* required */
  clientRequestToken: 'STRING_VALUE'
};
codecommit.postCommentReply(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • inReplyTo — (String)

      The system-generated ID of the comment to which you want to reply. To get this ID, use GetCommentsForComparedCommit or GetCommentsForPullRequest.

    • clientRequestToken — (String)

      A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

      If a token is not provided, the SDK will use a version 4 UUID.
    • content — (String)

      The contents of your reply to a comment.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • comment — (map)

        Information about the reply to a comment.

        • commentId — (String)

          The system-generated comment ID.

        • content — (String)

          The content of the comment.

        • inReplyTo — (String)

          The ID of the comment for which this comment is a reply, if any.

        • creationDate — (Date)

          The date and time the comment was created, in timestamp format.

        • lastModifiedDate — (Date)

          The date and time the comment was most recently modified, in timestamp format.

        • authorArn — (String)

          The Amazon Resource Name (ARN) of the person who posted the comment.

        • deleted — (Boolean)

          A Boolean value indicating whether the comment has been deleted.

        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • callerReactions — (Array<String>)

          The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.

        • reactionCounts — (map<Integer>)

          A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putCommentReaction(params = {}, callback) ⇒ AWS.Request

Adds or updates a reaction to a specified comment for the user whose identity is used to make the request. You can only add or update a reaction for yourself. You cannot add, modify, or delete a reaction for another user.

Service Reference:

Examples:

Calling the putCommentReaction operation

var params = {
  commentId: 'STRING_VALUE', /* required */
  reactionValue: 'STRING_VALUE' /* required */
};
codecommit.putCommentReaction(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • commentId — (String)

      The ID of the comment to which you want to add or update a reaction.

    • reactionValue — (String)

      The emoji reaction you want to add or update. To remove a reaction, provide a value of blank or null. You can also provide the value of none. For information about emoji reaction values supported in AWS CodeCommit, see the AWS CodeCommit User Guide.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putFile(params = {}, callback) ⇒ AWS.Request

Adds or updates a file in a branch in an AWS CodeCommit repository, and generates a commit for the addition in the specified branch.

Service Reference:

Examples:

Calling the putFile operation

var params = {
  branchName: 'STRING_VALUE', /* required */
  fileContent: Buffer.from('...') || 'STRING_VALUE' /* Strings will be Base-64 encoded on your behalf */, /* required */
  filePath: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  commitMessage: 'STRING_VALUE',
  email: 'STRING_VALUE',
  fileMode: EXECUTABLE | NORMAL | SYMLINK,
  name: 'STRING_VALUE',
  parentCommitId: 'STRING_VALUE'
};
codecommit.putFile(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to add or update the file.

    • branchName — (String)

      The name of the branch where you want to add or update the file. If this is an empty repository, this branch is created.

    • fileContent — (Buffer, Typed Array, Blob, String)

      The content of the file, in binary object format.

    • filePath — (String)

      The name of the file you want to add or update, including the relative path to the file in the repository.

      Note: If the path does not currently exist in the repository, the path is created as part of adding the file.
    • fileMode — (String)

      The file mode permissions of the blob. Valid file mode permissions are listed here.

      Possible values include:
      • "EXECUTABLE"
      • "NORMAL"
      • "SYMLINK"
    • parentCommitId — (String)

      The full commit ID of the head commit in the branch where you want to add or update the file. If this is an empty repository, no commit ID is required. If this is not an empty repository, a commit ID is required.

      The commit ID must match the ID of the head commit at the time of the operation. Otherwise, an error occurs, and the file is not added or updated.

    • commitMessage — (String)

      A message about why this file was added or updated. Although it is optional, a message makes the commit history for your repository more useful.

    • name — (String)

      The name of the person adding or updating the file. Although it is optional, a name makes the commit history for your repository more useful.

    • email — (String)

      An email address for the person adding or updating the file.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • commitId — (String)

        The full SHA ID of the commit that contains this file change.

      • blobId — (String)

        The ID of the blob, which is its SHA-1 pointer.

      • treeId — (String)

        The full SHA-1 pointer of the tree information for the commit that contains this file change.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putRepositoryTriggers(params = {}, callback) ⇒ AWS.Request

Replaces all triggers for a repository. Used to create or delete triggers.

Service Reference:

Examples:

Calling the putRepositoryTriggers operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  triggers: [ /* required */
    {
      destinationArn: 'STRING_VALUE', /* required */
      events: [ /* required */
        all | updateReference | createReference | deleteReference,
        /* more items */
      ],
      name: 'STRING_VALUE', /* required */
      branches: [
        'STRING_VALUE',
        /* more items */
      ],
      customData: 'STRING_VALUE'
    },
    /* more items */
  ]
};
codecommit.putRepositoryTriggers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository where you want to create or update the trigger.

    • triggers — (Array<map>)

      The JSON block of configuration information for each trigger.

      • namerequired — (String)

        The name of the trigger.

      • destinationArnrequired — (String)

        The ARN of the resource that is the target for a trigger (for example, the ARN of a topic in Amazon SNS).

      • customData — (String)

        Any custom data associated with the trigger to be included in the information sent to the target of the trigger.

      • branches — (Array<String>)

        The branches to be included in the trigger configuration. If you specify an empty array, the trigger applies to all branches.

        Note: Although no content is required in the array, you must include the array itself.
      • eventsrequired — (Array<String>)

        The repository events that cause the trigger to run actions in another service, such as sending a notification through Amazon SNS.

        Note: The valid value "all" cannot be used with any other values.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • configurationId — (String)

        The system-generated unique ID for the create or update operation.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

tagResource(params = {}, callback) ⇒ AWS.Request

Adds or updates tags for a resource in AWS CodeCommit. For a list of valid resources in AWS CodeCommit, see CodeCommit Resources and Operations in the AWS CodeCommit User Guide.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  tags: { /* required */
    '<TagKey>': 'STRING_VALUE',
    /* '<TagKey>': ... */
  }
};
codecommit.tagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • resourceArn — (String)

      The Amazon Resource Name (ARN) of the resource to which you want to add or update tags.

    • tags — (map<String>)

      The key-value pair to use when tagging this repository.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

testRepositoryTriggers(params = {}, callback) ⇒ AWS.Request

Tests the functionality of repository triggers by sending information to the trigger target. If real data is available in the repository, the test sends data from the last commit. If no data is available, sample data is generated.

Service Reference:

Examples:

Calling the testRepositoryTriggers operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  triggers: [ /* required */
    {
      destinationArn: 'STRING_VALUE', /* required */
      events: [ /* required */
        all | updateReference | createReference | deleteReference,
        /* more items */
      ],
      name: 'STRING_VALUE', /* required */
      branches: [
        'STRING_VALUE',
        /* more items */
      ],
      customData: 'STRING_VALUE'
    },
    /* more items */
  ]
};
codecommit.testRepositoryTriggers(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository in which to test the triggers.

    • triggers — (Array<map>)

      The list of triggers to test.

      • namerequired — (String)

        The name of the trigger.

      • destinationArnrequired — (String)

        The ARN of the resource that is the target for a trigger (for example, the ARN of a topic in Amazon SNS).

      • customData — (String)

        Any custom data associated with the trigger to be included in the information sent to the target of the trigger.

      • branches — (Array<String>)

        The branches to be included in the trigger configuration. If you specify an empty array, the trigger applies to all branches.

        Note: Although no content is required in the array, you must include the array itself.
      • eventsrequired — (Array<String>)

        The repository events that cause the trigger to run actions in another service, such as sending a notification through Amazon SNS.

        Note: The valid value "all" cannot be used with any other values.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • successfulExecutions — (Array<String>)

        The list of triggers that were successfully tested. This list provides the names of the triggers that were successfully tested, separated by commas.

      • failedExecutions — (Array<map>)

        The list of triggers that were not tested. This list provides the names of the triggers that could not be tested, separated by commas.

        • trigger — (String)

          The name of the trigger that did not run.

        • failureMessage — (String)

          Message information about the trigger that did not run.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

untagResource(params = {}, callback) ⇒ AWS.Request

Removes tags for a resource in AWS CodeCommit. For a list of valid resources in AWS CodeCommit, see CodeCommit Resources and Operations in the AWS CodeCommit User Guide.

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  tagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
codecommit.untagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • resourceArn — (String)

      The Amazon Resource Name (ARN) of the resource to which you want to remove tags.

    • tagKeys — (Array<String>)

      The tag key for each tag that you want to remove from the resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateApprovalRuleTemplateContent(params = {}, callback) ⇒ AWS.Request

Updates the content of an approval rule template. You can change the number of required approvals, the membership of the approval rule, and whether an approval pool is defined.

Examples:

Calling the updateApprovalRuleTemplateContent operation

var params = {
  approvalRuleTemplateName: 'STRING_VALUE', /* required */
  newRuleContent: 'STRING_VALUE', /* required */
  existingRuleContentSha256: 'STRING_VALUE'
};
codecommit.updateApprovalRuleTemplateContent(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • approvalRuleTemplateName — (String)

      The name of the approval rule template where you want to update the content of the rule.

    • newRuleContent — (String)

      The content that replaces the existing content of the rule. Content statements must be complete. You cannot provide only the changes.

    • existingRuleContentSha256 — (String)

      The SHA-256 hash signature for the content of the approval rule. You can retrieve this information by using GetPullRequest.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvalRuleTemplate — (map)

        Returns information about an approval rule template.

        • approvalRuleTemplateId — (String)

          The system-generated ID of the approval rule template.

        • approvalRuleTemplateName — (String)

          The name of the approval rule template.

        • approvalRuleTemplateDescription — (String)

          The description of the approval rule template.

        • approvalRuleTemplateContent — (String)

          The content of the approval rule template.

        • ruleContentSha256 — (String)

          The SHA-256 hash signature for the content of the approval rule template.

        • lastModifiedDate — (Date)

          The date the approval rule template was most recently changed, in timestamp format.

        • creationDate — (Date)

          The date the approval rule template was created, in timestamp format.

        • lastModifiedUser — (String)

          The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateApprovalRuleTemplateDescription(params = {}, callback) ⇒ AWS.Request

Updates the description for a specified approval rule template.

Examples:

Calling the updateApprovalRuleTemplateDescription operation

var params = {
  approvalRuleTemplateDescription: 'STRING_VALUE', /* required */
  approvalRuleTemplateName: 'STRING_VALUE' /* required */
};
codecommit.updateApprovalRuleTemplateDescription(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • approvalRuleTemplateName — (String)

      The name of the template for which you want to update the description.

    • approvalRuleTemplateDescription — (String)

      The updated description of the approval rule template.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvalRuleTemplate — (map)

        The structure and content of the updated approval rule template.

        • approvalRuleTemplateId — (String)

          The system-generated ID of the approval rule template.

        • approvalRuleTemplateName — (String)

          The name of the approval rule template.

        • approvalRuleTemplateDescription — (String)

          The description of the approval rule template.

        • approvalRuleTemplateContent — (String)

          The content of the approval rule template.

        • ruleContentSha256 — (String)

          The SHA-256 hash signature for the content of the approval rule template.

        • lastModifiedDate — (Date)

          The date the approval rule template was most recently changed, in timestamp format.

        • creationDate — (Date)

          The date the approval rule template was created, in timestamp format.

        • lastModifiedUser — (String)

          The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateApprovalRuleTemplateName(params = {}, callback) ⇒ AWS.Request

Updates the name of a specified approval rule template.

Service Reference:

Examples:

Calling the updateApprovalRuleTemplateName operation

var params = {
  newApprovalRuleTemplateName: 'STRING_VALUE', /* required */
  oldApprovalRuleTemplateName: 'STRING_VALUE' /* required */
};
codecommit.updateApprovalRuleTemplateName(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • oldApprovalRuleTemplateName — (String)

      The current name of the approval rule template.

    • newApprovalRuleTemplateName — (String)

      The new name you want to apply to the approval rule template.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvalRuleTemplate — (map)

        The structure and content of the updated approval rule template.

        • approvalRuleTemplateId — (String)

          The system-generated ID of the approval rule template.

        • approvalRuleTemplateName — (String)

          The name of the approval rule template.

        • approvalRuleTemplateDescription — (String)

          The description of the approval rule template.

        • approvalRuleTemplateContent — (String)

          The content of the approval rule template.

        • ruleContentSha256 — (String)

          The SHA-256 hash signature for the content of the approval rule template.

        • lastModifiedDate — (Date)

          The date the approval rule template was most recently changed, in timestamp format.

        • creationDate — (Date)

          The date the approval rule template was created, in timestamp format.

        • lastModifiedUser — (String)

          The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule template.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateComment(params = {}, callback) ⇒ AWS.Request

Replaces the contents of a comment.

Service Reference:

Examples:

Calling the updateComment operation

var params = {
  commentId: 'STRING_VALUE', /* required */
  content: 'STRING_VALUE' /* required */
};
codecommit.updateComment(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • comment — (map)

        Information about the updated comment.

        • commentId — (String)

          The system-generated comment ID.

        • content — (String)

          The content of the comment.

        • inReplyTo — (String)

          The ID of the comment for which this comment is a reply, if any.

        • creationDate — (Date)

          The date and time the comment was created, in timestamp format.

        • lastModifiedDate — (Date)

          The date and time the comment was most recently modified, in timestamp format.

        • authorArn — (String)

          The Amazon Resource Name (ARN) of the person who posted the comment.

        • deleted — (Boolean)

          A Boolean value indicating whether the comment has been deleted.

        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • callerReactions — (Array<String>)

          The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.

        • reactionCounts — (map<Integer>)

          A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateDefaultBranch(params = {}, callback) ⇒ AWS.Request

Sets or changes the default branch name for the specified repository.

Note: If you use this operation to change the default branch name to the current default branch name, a success message is returned even though the default branch did not change.

Service Reference:

Examples:

Calling the updateDefaultBranch operation

var params = {
  defaultBranchName: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE' /* required */
};
codecommit.updateDefaultBranch(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository to set or change the default branch for.

    • defaultBranchName — (String)

      The name of the branch to set as the default.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updatePullRequestApprovalRuleContent(params = {}, callback) ⇒ AWS.Request

Updates the structure of an approval rule created specifically for a pull request. For example, you can change the number of required approvers and the approval pool for approvers.

Examples:

Calling the updatePullRequestApprovalRuleContent operation

var params = {
  approvalRuleName: 'STRING_VALUE', /* required */
  newRuleContent: 'STRING_VALUE', /* required */
  pullRequestId: 'STRING_VALUE', /* required */
  existingRuleContentSha256: 'STRING_VALUE'
};
codecommit.updatePullRequestApprovalRuleContent(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request.

    • approvalRuleName — (String)

      The name of the approval rule you want to update.

    • existingRuleContentSha256 — (String)

      The SHA-256 hash signature for the content of the approval rule. You can retrieve this information by using GetPullRequest.

    • newRuleContent — (String)

      The updated content for the approval rule.

      Note: When you update the content of the approval rule, you can specify approvers in an approval pool in one of two ways:
      • CodeCommitApprovers: This option only requires an AWS account and a resource. It can be used for both IAM users and federated access users whose name matches the provided resource name. This is a very powerful option that offers a great deal of flexibility. For example, if you specify the AWS account 123456789012 and Mary_Major, all of the following are counted as approvals coming from that user:
        • An IAM user in the account (arn:aws:iam::123456789012:user/Mary_Major)
        • A federated user identified in IAM as Mary_Major (arn:aws:sts::123456789012:federated-user/Mary_Major)
        This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role session name of Mary_Major (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) unless you include a wildcard (*Mary_Major).
      • Fully qualified ARN: This option allows you to specify the fully qualified Amazon Resource Name (ARN) of the IAM user or role.
      For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in the IAM User Guide.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • approvalRule — (map)

        Information about the updated approval rule.

        • approvalRuleId — (String)

          The system-generated ID of the approval rule.

        • approvalRuleName — (String)

          The name of the approval rule.

        • approvalRuleContent — (String)

          The content of the approval rule.

        • ruleContentSha256 — (String)

          The SHA-256 hash signature for the content of the approval rule.

        • lastModifiedDate — (Date)

          The date the approval rule was most recently changed, in timestamp format.

        • creationDate — (Date)

          The date the approval rule was created, in timestamp format.

        • lastModifiedUser — (String)

          The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

        • originApprovalRuleTemplate — (map)

          The approval rule template used to create the rule.

          • approvalRuleTemplateId — (String)

            The ID of the template that created the approval rule.

          • approvalRuleTemplateName — (String)

            The name of the template that created the approval rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updatePullRequestApprovalState(params = {}, callback) ⇒ AWS.Request

Updates the state of a user's approval on a pull request. The user is derived from the signed-in account when the request is made.

Service Reference:

Examples:

Calling the updatePullRequestApprovalState operation

var params = {
  approvalState: APPROVE | REVOKE, /* required */
  pullRequestId: 'STRING_VALUE', /* required */
  revisionId: 'STRING_VALUE' /* required */
};
codecommit.updatePullRequestApprovalState(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request.

    • revisionId — (String)

      The system-generated ID of the revision.

    • approvalState — (String)

      The approval state to associate with the user on the pull request.

      Possible values include:
      • "APPROVE"
      • "REVOKE"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updatePullRequestDescription(params = {}, callback) ⇒ AWS.Request

Replaces the contents of the description of a pull request.

Service Reference:

Examples:

Calling the updatePullRequestDescription operation

var params = {
  description: 'STRING_VALUE', /* required */
  pullRequestId: 'STRING_VALUE' /* required */
};
codecommit.updatePullRequestDescription(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request. To get this ID, use ListPullRequests.

    • description — (String)

      The updated content of the description for the pull request. This content replaces the existing description.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • pullRequest — (map)

        Information about the updated pull request.

        • pullRequestId — (String)

          The system-generated ID of the pull request.

        • title — (String)

          The user-defined title of the pull request. This title is displayed in the list of pull requests to other repository users.

        • description — (String)

          The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

        • lastActivityDate — (Date)

          The day and time of the last user or system activity on the pull request, in timestamp format.

        • creationDate — (Date)

          The date and time the pull request was originally created, in timestamp format.

        • pullRequestStatus — (String)

          The status of the pull request. Pull request status can only change from OPEN to CLOSED.

          Possible values include:
          • "OPEN"
          • "CLOSED"
        • authorArn — (String)

          The Amazon Resource Name (ARN) of the user who created the pull request.

        • pullRequestTargets — (Array<map>)

          The targets of the pull request, including the source branch and destination branch for the pull request.

          • repositoryName — (String)

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference — (String)

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference — (String)

            The branch of the repository where the pull request changes are merged. Also known as the destination branch.

          • destinationCommit — (String)

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit — (String)

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID changes to reflect the new tip of the branch.

          • mergeBase — (String)

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

          • mergeMetadata — (map)

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged — (Boolean)

              A Boolean value indicating whether the merge has been made.

            • mergedBy — (String)

              The Amazon Resource Name (ARN) of the user who merged the branches.

            • mergeCommitId — (String)

              The commit ID for the merge commit, if any.

            • mergeOption — (String)

              The merge strategy used in the merge.

              Possible values include:
              • "FAST_FORWARD_MERGE"
              • "SQUASH_MERGE"
              • "THREE_WAY_MERGE"
        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • revisionId — (String)

          The system-generated revision ID for the pull request.

        • approvalRules — (Array<map>)

          The approval rules applied to the pull request.

          • approvalRuleId — (String)

            The system-generated ID of the approval rule.

          • approvalRuleName — (String)

            The name of the approval rule.

          • approvalRuleContent — (String)

            The content of the approval rule.

          • ruleContentSha256 — (String)

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate — (Date)

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate — (Date)

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser — (String)

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate — (map)

            The approval rule template used to create the rule.

            • approvalRuleTemplateId — (String)

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName — (String)

              The name of the template that created the approval rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updatePullRequestStatus(params = {}, callback) ⇒ AWS.Request

Updates the status of a pull request.

Service Reference:

Examples:

Calling the updatePullRequestStatus operation

var params = {
  pullRequestId: 'STRING_VALUE', /* required */
  pullRequestStatus: OPEN | CLOSED /* required */
};
codecommit.updatePullRequestStatus(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request. To get this ID, use ListPullRequests.

    • pullRequestStatus — (String)

      The status of the pull request. The only valid operations are to update the status from OPEN to OPEN, OPEN to CLOSED or from CLOSED to CLOSED.

      Possible values include:
      • "OPEN"
      • "CLOSED"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • pullRequest — (map)

        Information about the pull request.

        • pullRequestId — (String)

          The system-generated ID of the pull request.

        • title — (String)

          The user-defined title of the pull request. This title is displayed in the list of pull requests to other repository users.

        • description — (String)

          The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

        • lastActivityDate — (Date)

          The day and time of the last user or system activity on the pull request, in timestamp format.

        • creationDate — (Date)

          The date and time the pull request was originally created, in timestamp format.

        • pullRequestStatus — (String)

          The status of the pull request. Pull request status can only change from OPEN to CLOSED.

          Possible values include:
          • "OPEN"
          • "CLOSED"
        • authorArn — (String)

          The Amazon Resource Name (ARN) of the user who created the pull request.

        • pullRequestTargets — (Array<map>)

          The targets of the pull request, including the source branch and destination branch for the pull request.

          • repositoryName — (String)

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference — (String)

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference — (String)

            The branch of the repository where the pull request changes are merged. Also known as the destination branch.

          • destinationCommit — (String)

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit — (String)

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID changes to reflect the new tip of the branch.

          • mergeBase — (String)

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

          • mergeMetadata — (map)

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged — (Boolean)

              A Boolean value indicating whether the merge has been made.

            • mergedBy — (String)

              The Amazon Resource Name (ARN) of the user who merged the branches.

            • mergeCommitId — (String)

              The commit ID for the merge commit, if any.

            • mergeOption — (String)

              The merge strategy used in the merge.

              Possible values include:
              • "FAST_FORWARD_MERGE"
              • "SQUASH_MERGE"
              • "THREE_WAY_MERGE"
        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • revisionId — (String)

          The system-generated revision ID for the pull request.

        • approvalRules — (Array<map>)

          The approval rules applied to the pull request.

          • approvalRuleId — (String)

            The system-generated ID of the approval rule.

          • approvalRuleName — (String)

            The name of the approval rule.

          • approvalRuleContent — (String)

            The content of the approval rule.

          • ruleContentSha256 — (String)

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate — (Date)

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate — (Date)

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser — (String)

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate — (map)

            The approval rule template used to create the rule.

            • approvalRuleTemplateId — (String)

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName — (String)

              The name of the template that created the approval rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updatePullRequestTitle(params = {}, callback) ⇒ AWS.Request

Replaces the title of a pull request.

Service Reference:

Examples:

Calling the updatePullRequestTitle operation

var params = {
  pullRequestId: 'STRING_VALUE', /* required */
  title: 'STRING_VALUE' /* required */
};
codecommit.updatePullRequestTitle(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • pullRequestId — (String)

      The system-generated ID of the pull request. To get this ID, use ListPullRequests.

    • title — (String)

      The updated title of the pull request. This replaces the existing title.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • pullRequest — (map)

        Information about the updated pull request.

        • pullRequestId — (String)

          The system-generated ID of the pull request.

        • title — (String)

          The user-defined title of the pull request. This title is displayed in the list of pull requests to other repository users.

        • description — (String)

          The user-defined description of the pull request. This description can be used to clarify what should be reviewed and other details of the request.

        • lastActivityDate — (Date)

          The day and time of the last user or system activity on the pull request, in timestamp format.

        • creationDate — (Date)

          The date and time the pull request was originally created, in timestamp format.

        • pullRequestStatus — (String)

          The status of the pull request. Pull request status can only change from OPEN to CLOSED.

          Possible values include:
          • "OPEN"
          • "CLOSED"
        • authorArn — (String)

          The Amazon Resource Name (ARN) of the user who created the pull request.

        • pullRequestTargets — (Array<map>)

          The targets of the pull request, including the source branch and destination branch for the pull request.

          • repositoryName — (String)

            The name of the repository that contains the pull request source and destination branches.

          • sourceReference — (String)

            The branch of the repository that contains the changes for the pull request. Also known as the source branch.

          • destinationReference — (String)

            The branch of the repository where the pull request changes are merged. Also known as the destination branch.

          • destinationCommit — (String)

            The full commit ID that is the tip of the destination branch. This is the commit where the pull request was or will be merged.

          • sourceCommit — (String)

            The full commit ID of the tip of the source branch used to create the pull request. If the pull request branch is updated by a push while the pull request is open, the commit ID changes to reflect the new tip of the branch.

          • mergeBase — (String)

            The commit ID of the most recent commit that the source branch and the destination branch have in common.

          • mergeMetadata — (map)

            Returns metadata about the state of the merge, including whether the merge has been made.

            • isMerged — (Boolean)

              A Boolean value indicating whether the merge has been made.

            • mergedBy — (String)

              The Amazon Resource Name (ARN) of the user who merged the branches.

            • mergeCommitId — (String)

              The commit ID for the merge commit, if any.

            • mergeOption — (String)

              The merge strategy used in the merge.

              Possible values include:
              • "FAST_FORWARD_MERGE"
              • "SQUASH_MERGE"
              • "THREE_WAY_MERGE"
        • clientRequestToken — (String)

          A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.

        • revisionId — (String)

          The system-generated revision ID for the pull request.

        • approvalRules — (Array<map>)

          The approval rules applied to the pull request.

          • approvalRuleId — (String)

            The system-generated ID of the approval rule.

          • approvalRuleName — (String)

            The name of the approval rule.

          • approvalRuleContent — (String)

            The content of the approval rule.

          • ruleContentSha256 — (String)

            The SHA-256 hash signature for the content of the approval rule.

          • lastModifiedDate — (Date)

            The date the approval rule was most recently changed, in timestamp format.

          • creationDate — (Date)

            The date the approval rule was created, in timestamp format.

          • lastModifiedUser — (String)

            The Amazon Resource Name (ARN) of the user who made the most recent changes to the approval rule.

          • originApprovalRuleTemplate — (map)

            The approval rule template used to create the rule.

            • approvalRuleTemplateId — (String)

              The ID of the template that created the approval rule.

            • approvalRuleTemplateName — (String)

              The name of the template that created the approval rule.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateRepositoryDescription(params = {}, callback) ⇒ AWS.Request

Sets or changes the comment or description for a repository.

Note: The description field for a repository accepts all HTML characters and all valid Unicode characters. Applications that do not HTML-encode the description and display it in a webpage can expose users to potentially malicious code. Make sure that you HTML-encode the description field in any application that uses this API to display the repository description on a webpage.

Service Reference:

Examples:

Calling the updateRepositoryDescription operation

var params = {
  repositoryName: 'STRING_VALUE', /* required */
  repositoryDescription: 'STRING_VALUE'
};
codecommit.updateRepositoryDescription(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • repositoryName — (String)

      The name of the repository to set or change the comment or description for.

    • repositoryDescription — (String)

      The new comment or description for the specified repository. Repository descriptions are limited to 1,000 characters.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateRepositoryName(params = {}, callback) ⇒ AWS.Request

Renames a repository. The repository name must be unique across the calling AWS account. Repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. The suffix .git is prohibited. For more information about the limits on repository names, see Limits in the AWS CodeCommit User Guide.

Service Reference:

Examples:

Calling the updateRepositoryName operation

var params = {
  newName: 'STRING_VALUE', /* required */
  oldName: 'STRING_VALUE' /* required */
};
codecommit.updateRepositoryName(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • oldName — (String)

      The current name of the repository.

    • newName — (String)

      The new name for the repository.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.