Class ExternalStatusCheckApi

    • Constructor Detail

      • ExternalStatusCheckApi

        public ExternalStatusCheckApi​(GitLabApi gitLabApi)
    • Method Detail

      • getExternalStatusChecks

        public java.util.List<ExternalStatusCheck> getExternalStatusChecks​(java.lang.Object projectIdOrPath)
                                                                    throws GitLabApiException
        Gets a list of all external status checks for a given project.
        GitLab Endpoint: GET /projects/:id/external_status_checks
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        Returns:
        a List of ExternalStatusCheck
        Throws:
        GitLabApiException - if any exception occurs
      • getExternalStatusChecks

        public Pager<ExternalStatusCheck> getExternalStatusChecks​(java.lang.Object projectIdOrPath,
                                                                  int itemsPerPage)
                                                           throws GitLabApiException
        Gets a Pager of all external status checks for a given project.
        GitLab Endpoint: GET /projects/:id/external_status_checks
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        itemsPerPage - the number of ExternalStatusCheck instances that will be fetched per page
        Returns:
        the Pager of ExternalStatusCheck instances
        Throws:
        GitLabApiException - if any exception occurs
      • getExternalStatusChecksStream

        public java.util.stream.Stream<ExternalStatusCheck> getExternalStatusChecksStream​(java.lang.Object projectIdOrPath)
                                                                                   throws GitLabApiException
        Gets a Stream of all external status checks for a given project.
        GitLab Endpoint: GET /projects/:id/external_status_checks
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        Returns:
        a Stream of ExternalStatusCheck
        Throws:
        GitLabApiException - if any exception occurs
      • createExternalStatusCheck

        public ExternalStatusCheck createExternalStatusCheck​(java.lang.Object projectIdOrPath,
                                                             java.lang.String name,
                                                             java.lang.String externalUrl,
                                                             java.util.List<java.lang.Long> protectedBranchIds)
                                                      throws GitLabApiException
        Creates a new external status check.
        GitLab Endpoint: POST /projects/:id/external_status_checks
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        name - Display name of external status check (required)
        externalUrl - URL of external status check resource (optional)
        protectedBranchIds - IDs of protected branches to scope the rule by (optional)
        Returns:
        an ExternalStatusCheck instance containing info on the newly created externalStatusCheck
        Throws:
        GitLabApiException - if any exception occurs
      • createExternalStatusCheck

        public ExternalStatusCheck createExternalStatusCheck​(java.lang.Object projectIdOrPath,
                                                             ExternalStatusCheck externalStatusCheck)
                                                      throws GitLabApiException
        Creates a new external status check using the information contained in the provided ExternalStatusCheck instance. Only the following fields from the ExternalStatusCheck instance are used:
        
              name - Display name of external status check (required)
              external url - URL of external status check resource (required)
              protected branches - the id of the protected branches (optional)
         
        GitLab Endpoint: POST /projects/:id/external_status_checks
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        externalStatusCheck - the ExternalStatusCheck instance with information for the new external status check
        Returns:
        an ExternalStatusCheck instance containing info on the newly created externalStatusCheck
        Throws:
        GitLabApiException - if any exception occurs
      • updateExternalStatusCheck

        public ExternalStatusCheck updateExternalStatusCheck​(java.lang.Object projectIdOrPath,
                                                             java.lang.Long checkId,
                                                             java.lang.String name,
                                                             java.lang.String externalUrl,
                                                             java.util.List<java.lang.Long> protectedBranchIds)
                                                      throws GitLabApiException
        Updates an existing external status check.
        GitLab Endpoint: PUT /projects/:id/external_status_checks/:check_id
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        checkId - ID of an external status check to update (required)
        name - Display name of external status check (optional)
        externalUrl - URL of external status check resource (optional)
        protectedBranchIds - IDs of protected branches to scope the rule by (optional)
        Returns:
        an ExternalStatusCheck instance containing info on the newly created ExternalStatusCheck
        Throws:
        GitLabApiException - if any exception occurs
      • updateExternalStatusCheck

        public ExternalStatusCheck updateExternalStatusCheck​(java.lang.Object projectIdOrPath,
                                                             ExternalStatusCheck externalStatusCheck)
                                                      throws GitLabApiException
        Updates an external status check using the information contained in the provided ExternalStatusCheck instance. Only the following fields from the ExternalStatusCheck instance are used:
        
              id - the id of the external status check (required)
              name - Display name of external status check (optional)
              external url - URL of external status check resource (optional)
              protected branches - the id of the protected branches (optional)
         
        GitLab Endpoint: PUT /projects/:id/external_status_checks/:check_id
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        externalStatusCheck - the ExternalStatusCheck instance with update information
        Returns:
        an ExternalStatusCheck instance containing info on the updated ExternalStatusCheck
        Throws:
        GitLabApiException - if any exception occurs
      • deleteExternalStatusCheck

        public void deleteExternalStatusCheck​(java.lang.Object projectIdOrPath,
                                              java.lang.Long checkId)
                                       throws GitLabApiException
        Deletes an external status check.
        GitLab Endpoint: DELETE /projects/:id/external_status_checks/:check_id
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        checkId - ID of an external status check
        Throws:
        GitLabApiException - if any exception occurs
      • getExternalStatusCheckStatuses

        public java.util.List<ExternalStatusCheckStatus> getExternalStatusCheckStatuses​(java.lang.Object projectIdOrPath,
                                                                                        java.lang.Long mergeRequestIid)
                                                                                 throws GitLabApiException
        Gets a list of all statuses of the external status checks for a given merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/status_checks
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        mergeRequestIid - the merge request IID to get the statuses
        Returns:
        a List of ExternalStatusCheckStatus
        Throws:
        GitLabApiException - if any exception occurs
      • getExternalStatusCheckStatuses

        public Pager<ExternalStatusCheckStatus> getExternalStatusCheckStatuses​(java.lang.Object projectIdOrPath,
                                                                               java.lang.Long mergeRequestIid,
                                                                               int itemsPerPage)
                                                                        throws GitLabApiException
        Gets a Pager of all statuses of the external status checks for a given merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/status_checks
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        mergeRequestIid - the merge request IID to get the statuses
        itemsPerPage - the number of ExternalStatusCheckStatus instances that will be fetched per page
        Returns:
        the Pager of ExternalStatusCheckStatus instances
        Throws:
        GitLabApiException - if any exception occurs
      • getExternalStatusCheckStatusesStream

        public java.util.stream.Stream<ExternalStatusCheckStatus> getExternalStatusCheckStatusesStream​(java.lang.Object projectIdOrPath,
                                                                                                       java.lang.Long mergeRequestIid)
                                                                                                throws GitLabApiException
        Gets a Stream of all statuses of the external status checks for a given merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/status_checks
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        mergeRequestIid - the merge request IID to get the statuses
        Returns:
        a Stream of ExternalStatusCheckStatus
        Throws:
        GitLabApiException - if any exception occurs
      • setStatusOfExternalStatusCheck

        public ExternalStatusCheckResult setStatusOfExternalStatusCheck​(java.lang.Object projectIdOrPath,
                                                                        java.lang.Long mergeRequestIid,
                                                                        java.lang.String sha,
                                                                        java.lang.Long externalStatusCheckId,
                                                                        ExternalStatusCheckStatus.Status status)
                                                                 throws GitLabApiException
        Set the status of an external status check for a given merge request.
        GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/status_check_responses
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        mergeRequestIid - the merge request IID to get the statuses
        sha - the commit SHA to set the status for (required)
        externalStatusCheckId - ID of an external status check (required)
        status - the status to set (optional)
        Returns:
        an ExternalStatusCheckResult instance containing info on the newly created status
        Throws:
        GitLabApiException - if any exception occurs
      • retryExternalStatusCheck

        public void retryExternalStatusCheck​(java.lang.Object projectIdOrPath,
                                             java.lang.Long mergeRequestIid,
                                             java.lang.Long externalStatusCheckId)
                                      throws GitLabApiException
        Retry the specified failed external status check for a single merge request. Even though the merge request hasn’t changed, this endpoint resends the current state of merge request to the defined external service.
        GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/status_checks/:external_status_check_id/retry
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        mergeRequestIid - the merge request IID to get the statuses
        externalStatusCheckId - ID of an external status check
        Throws:
        GitLabApiException - if any exception occurs