Class ExternalStatusCheckApi

  • All Implemented Interfaces:
    org.gitlab4j.models.Constants

    public class ExternalStatusCheckApi
    extends AbstractApi
    This class implements the client side API for the GitLab external status checks. See External Status Checks API for more information.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.gitlab4j.models.Constants

        org.gitlab4j.models.Constants.ActionType, org.gitlab4j.models.Constants.ApplicationScope, org.gitlab4j.models.Constants.ArchiveFormat, org.gitlab4j.models.Constants.AutoCancelPendingPipelines, org.gitlab4j.models.Constants.AutoDevopsDeployStrategy, org.gitlab4j.models.Constants.BuildGitStrategy, org.gitlab4j.models.Constants.CommitBuildState, org.gitlab4j.models.Constants.ContributorOrderBy, org.gitlab4j.models.Constants.DefaultBranchProtectionLevel, org.gitlab4j.models.Constants.DeploymentOrderBy, org.gitlab4j.models.Constants.DeploymentStatus, org.gitlab4j.models.Constants.DeployTokenScope, org.gitlab4j.models.Constants.Encoding, org.gitlab4j.models.Constants.EpicOrderBy, org.gitlab4j.models.Constants.EventScope, org.gitlab4j.models.Constants.GroupOrderBy, org.gitlab4j.models.Constants.GroupSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.ImpersonationState, org.gitlab4j.models.Constants.IssueOrderBy, org.gitlab4j.models.Constants.IssueScope, org.gitlab4j.models.Constants.IssueState, org.gitlab4j.models.Constants.JobScope, org.gitlab4j.models.Constants.LineType, org.gitlab4j.models.Constants.MergeRequestOrderBy, org.gitlab4j.models.Constants.MergeRequestScope, org.gitlab4j.models.Constants.MergeRequestSearchIn, org.gitlab4j.models.Constants.MergeRequestState, org.gitlab4j.models.Constants.MilestoneState, org.gitlab4j.models.Constants.PackageOrderBy, org.gitlab4j.models.Constants.PackageStatus, org.gitlab4j.models.Constants.PipelineOrderBy, org.gitlab4j.models.Constants.PipelineScope, org.gitlab4j.models.Constants.PipelineSource, org.gitlab4j.models.Constants.ProjectAccessTokenScope, org.gitlab4j.models.Constants.ProjectCreationLevel, org.gitlab4j.models.Constants.ProjectFeatureVisibilityAccessLevel, org.gitlab4j.models.Constants.ProjectOrderBy, org.gitlab4j.models.Constants.ProjectSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SortOrder, org.gitlab4j.models.Constants.SquashOption, org.gitlab4j.models.Constants.StateEvent, org.gitlab4j.models.Constants.SubgroupCreationLevel, org.gitlab4j.models.Constants.TagOrderBy, org.gitlab4j.models.Constants.TargetType, org.gitlab4j.models.Constants.TodoAction, org.gitlab4j.models.Constants.TodoState, org.gitlab4j.models.Constants.TodoType, org.gitlab4j.models.Constants.TokenType
    • Field Summary

      • Fields inherited from interface org.gitlab4j.models.Constants

        NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
    • Constructor Detail

      • ExternalStatusCheckApi

        public ExternalStatusCheckApi​(GitLabApi gitLabApi)
    • Method Detail

      • getExternalStatusChecks

        public java.util.List<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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 org.gitlab4j.api.models.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 org.gitlab4j.api.models.ExternalStatusCheck createExternalStatusCheck​(java.lang.Object projectIdOrPath,
                                                                                     org.gitlab4j.api.models.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 org.gitlab4j.api.models.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 org.gitlab4j.api.models.ExternalStatusCheck updateExternalStatusCheck​(java.lang.Object projectIdOrPath,
                                                                                     org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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<org.gitlab4j.api.models.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 org.gitlab4j.api.models.ExternalStatusCheckResult setStatusOfExternalStatusCheck​(java.lang.Object projectIdOrPath,
                                                                                                java.lang.Long mergeRequestIid,
                                                                                                java.lang.String sha,
                                                                                                java.lang.Long externalStatusCheckId,
                                                                                                org.gitlab4j.api.models.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