Skip to content

get_pull_request_approval_states

get_pull_request_approval_states(
    pull_request_id: PullRequestId,
    revision_id: RevisionId,
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
) -> GetPullRequestApprovalStatesOutput

Gets information about the approval states for a specified pull request. Approval states only apply to pull requests that have one or more approval rules applied to them.

Parameters:

  • pull_request_id (PullRequestId) –

    The system-generated ID for the pull request.

  • revision_id (RevisionId) –

    The system-generated ID for the pull request revision.

Raises:

Source code in docs_src/capo_codecommit/_services/code_commit.py
def get_pull_request_approval_states(
    self,
    pull_request_id: "capo_codecommit.types.pull_request_id.PullRequestId",
    revision_id: "capo_codecommit.types.revision_id.RevisionId",
    *,
    config_overrides: Optional[CodeCommitClientConfig] = None,
) -> "capo_codecommit.types.get_pull_request_approval_states_output.GetPullRequestApprovalStatesOutput":
    """<p>Gets information about the approval states for a specified pull request. Approval states only apply to pull requests that have one or more approval rules applied to them.</p>

    Args:
        pull_request_id: <p>The system-generated ID for the pull request.</p>
        revision_id: <p>The system-generated ID for the pull request revision.</p>

    Raises:
        capo_codecommit.errors.encryption_integrity_checks_failed_exception.EncryptionIntegrityChecksFailedException: <p>An encryption integrity check failed.</p>
        capo_codecommit.errors.encryption_key_access_denied_exception.EncryptionKeyAccessDeniedException: <p>An encryption key could not be accessed.</p>
        capo_codecommit.errors.encryption_key_disabled_exception.EncryptionKeyDisabledException: <p>The encryption key is disabled.</p>
        capo_codecommit.errors.encryption_key_not_found_exception.EncryptionKeyNotFoundException: <p>No encryption key was found.</p>
        capo_codecommit.errors.encryption_key_unavailable_exception.EncryptionKeyUnavailableException: <p>The encryption key is not available.</p>
        capo_codecommit.errors.invalid_pull_request_id_exception.InvalidPullRequestIdException: <p>The pull request ID is not valid. Make sure that you have provided the full ID and that the pull request is in the specified repository, and then try again.</p>
        capo_codecommit.errors.invalid_revision_id_exception.InvalidRevisionIdException: <p>The revision ID is not valid. Use GetPullRequest to determine the value.</p>
        capo_codecommit.errors.pull_request_does_not_exist_exception.PullRequestDoesNotExistException: <p>The pull request ID could not be found. Make sure that you have specified the correct repository name and pull request ID, and then try again.</p>
        capo_codecommit.errors.pull_request_id_required_exception.PullRequestIdRequiredException: <p>A pull request ID is required, but none was provided.</p>
        capo_codecommit.errors.revision_id_required_exception.RevisionIdRequiredException: <p>A revision ID is required, but was not provided.</p>
        capo_codecommit.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_codecommit.types.get_pull_request_approval_states_input.GetPullRequestApprovalStatesInput]",
    ) -> OperationResponse[
        "capo_codecommit.types.get_pull_request_approval_states_output.GetPullRequestApprovalStatesOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.get_pull_request_approval_states

        output, http_response = (
            capo_codecommit._operations.code_commit_20150413.get_pull_request_approval_states.get_pull_request_approval_states(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetPullRequestApprovalStates")
    )
    input_: capo_codecommit.types.get_pull_request_approval_states_input.GetPullRequestApprovalStatesInput = {
        "pull_request_id": pull_request_id,
        "revision_id": revision_id,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output