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.

Sending a Request Using CodeCommit

var codecommit = new AWS.CodeCommit();
codecommit.batchGetRepositories(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)

    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'.

  • 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.

  • 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 returns the amount of time to delay in milliseconds. The base option will be ignored if this option is supplied.
  • 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.

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

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 web page could 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 web page.

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.

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.

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

Creates a new 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.

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 will be 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 will be merged into. 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 will return information about the initial request that used that token.

      Note: The AWS SDKs prepopulate client request tokens. If using an AWS SDK, you do not have to generate an idempotency token, as this will be done 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 users of the repository.

        • 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 will be merged into. 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 will change to reflect the new tip of the branch.

          • 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.

        • 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 will return information about the initial request that used that token.

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'
};
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. In addition, repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. For a full description of 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 web page could 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 web page.

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.

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 will return information about the initial request that used that token.

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 will be returned.

Deleting a repository also deletes all associated objects and metadata. After a repository is deleted, all future push calls to the deleted repository will 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.

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: 0,
  nextToken: 'STRING_VALUE',
  pullRequestEventType: PULL_REQUEST_CREATED | PULL_REQUEST_STATUS_CHANGED | PULL_REQUEST_SOURCE_REFERENCE_UPDATED | PULL_REQUEST_MERGE_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"
    • actorArn — (String)

      The Amazon Resource Name (ARN) of the user whose actions resulted in the event. Examples include updating the pull request with additional 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-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"
        • actorArn — (String)

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

        • 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.

        • 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 will be 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.

      • 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.

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

Returns the base-64 encoded content of an individual blob within 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, Typed Array, Blob, String)

        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.

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 will return information about the initial request that used that token.

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.

Service Reference:

Examples:

Calling the getCommentsForComparedCommit operation

var params = {
  afterCommitId: 'STRING_VALUE', /* required */
  repositoryName: 'STRING_VALUE', /* required */
  beforeCommitId: 'STRING_VALUE',
  maxResults: 0,
  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-negative integer used to limit the number of returned results. The default is 100 comments, and is configurable 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 within 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 will return information about the initial request that used that token.

      • 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.

Service Reference:

Examples:

Calling the getCommentsForPullRequest operation

var params = {
  pullRequestId: 'STRING_VALUE', /* required */
  afterCommitId: 'STRING_VALUE',
  beforeCommitId: 'STRING_VALUE',
  maxResults: 0,
  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-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 will be superceded by the after commit in the source branch when and if you merge the source branch into the destination branch.

        • afterCommitId — (String)

          he 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 within 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 will return information about the initial request that used that token.

      • 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 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 of the specified commit.

        • treeId — (String)

          Tree information for the specified commit.

        • parents — (Array<String>)

          The parent list for the specified commit.

        • 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 pushed to the repository.

        • 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 pushed to the repository.

        • additionalData — (String)

          Any additional 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: 0,
  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 prior to the afterCommitSpecifier value will be 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 will be 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 will be shown for all paths.

    • MaxResults — (Integer)

      A 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 differences 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 any 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 any 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.

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, /* required */
  repositoryName: 'STRING_VALUE', /* required */
  sourceCommitSpecifier: 'STRING_VALUE' /* required */
};
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. The only valid value is FAST_FORWARD_MERGE.

      Possible values include:
      • "FAST_FORWARD_MERGE"

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 mergable 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.

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 users of the repository.

        • 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 will be merged into. 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 will change to reflect the new tip of the branch.

          • 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.

        • 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 will return information about the initial request that used that token.

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 web page could 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 web page.

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 Simple Notification Service (SNS).

        • customData — (String)

          Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.

        • branches — (Array<String>)

          The branches that will be included in the trigger configuration. If you specify an empty array, the trigger will apply to all branches.

          Note: While no content is required in the array, you must include the array itself.
        • eventsrequired — (Array<String>)

          The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (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.

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: 0,
  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-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 when provided in a request, returns the next batch of the results.

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.

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

Closes a pull request and 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 option.

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 information about 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 users of the repository.

        • 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 will be merged into. 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 will change to reflect the new tip of the branch.

          • 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.

        • 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 will return information about the initial request that used that token.

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: 0,
    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.

    • 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 within 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 will return 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 within 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 will return information about the initial request that used that token.

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: 0,
    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 will be 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 within 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 will return 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 will be 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 within 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 will return information about the initial request that used that token.

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 will return 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 will return information about the initial request that used that token.

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. This can be 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 Simple Notification Service (SNS).

      • customData — (String)

        Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.

      • branches — (Array<String>)

        The branches that will be included in the trigger configuration. If you specify an empty array, the trigger will apply to all branches.

        Note: While no content is required in the array, you must include the array itself.
      • eventsrequired — (Array<String>)

        The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (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.

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 will send data from the last commit. If no data is available, sample data will be 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 Simple Notification Service (SNS).

      • customData — (String)

        Any custom data associated with the trigger that will be included in the information sent to the target of the trigger.

      • branches — (Array<String>)

        The branches that will be included in the trigger configuration. If you specify an empty array, the trigger will apply to all branches.

        Note: While no content is required in the array, you must include the array itself.
      • eventsrequired — (Array<String>)

        The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (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 able to be 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)

          Additional message information about the trigger that did not run.

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: {})
    • commentId — (String)

      The system-generated ID of the comment you want to update. To get this ID, use GetCommentsForComparedCommit or GetCommentsForPullRequest.

    • content — (String)

      The updated content with which you want to replace the existing content of the 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 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 will return information about the initial request that used that token.

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.

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 will replace 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 users of the repository.

        • 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 will be merged into. 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 will change to reflect the new tip of the branch.

          • 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.

        • 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 will return information about the initial request that used that token.

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 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 users of the repository.

        • 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 will be merged into. 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 will change to reflect the new tip of the branch.

          • 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.

        • 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 will return information about the initial request that used that token.

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 will replace 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 users of the repository.

        • 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 will be merged into. 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 will change to reflect the new tip of the branch.

          • 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.

        • 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 will return information about the initial request that used that token.

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 web page could 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 web page.

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. In addition, repository names are limited to 100 alphanumeric, dash, and underscore characters, and cannot include certain characters. The suffix ".git" is prohibited. For a full description of 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 existing 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.