// Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
//     String getHostUrl();
// 
//     Project createProject(String projectName);
// 
//     MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// 
//     Project getProject(String projectName);
// 
//     Project updateProject(String projectId, String name, String path);
// 
//     void deleteProject(String projectId);
// 
//     void addProjectHook(String projectId, String url, Boolean pushEvents, Boolean mergeRequestEvents, Boolean noteEvents);
// 
//     void changeBuildStatus(String projectId, String sha, BuildState state, String ref, String context, String targetUrl, String description);
// 
//     void changeBuildStatus(Integer projectId, String sha, BuildState state, String ref, String context, String targetUrl, String description);
// 
//     void getCommit(String projectId, String sha);
// 
//     void acceptMergeRequest(MergeRequest mr, String mergeCommitMessage, Boolean shouldRemoveSourceBranch);
// 
//     void createMergeRequestNote(MergeRequest mr, String body);
// 
//     List<Awardable> getMergeRequestEmoji(MergeRequest mr);
// 
//     void awardMergeRequestEmoji(MergeRequest mr, String name);
// 
//     void deleteMergeRequestEmoji(MergeRequest mr, Integer awardId);
// 
//     List<MergeRequest> getMergeRequests(String projectId, State state, int page, int perPage);
// 
//     List<Branch> getBranches(String projectId);
// 
//     Branch getBranch(String projectId, String branch);
// 
//     User getCurrentUser();
// 
//     User addUser(String email, String username, String name, String password);
// 
//     User updateUser(String userId, String email, String username, String name, String password);
// 
//     List<Label> getLabels(String projectId);
// 
//     List<Pipeline> getPipelines(String projectName);
// }
// 
// Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClientBuilder.java
// @Restricted(NoExternalUse.class)
// public abstract class GitLabClientBuilder implements Comparable<GitLabClientBuilder>, ExtensionPoint, Serializable {
//     public static GitLabClientBuilder getGitLabClientBuilderById(String id) {
//         for (GitLabClientBuilder provider : getAllGitLabClientBuilders()) {
//             if (provider.id().equals(id)) {
//                 return provider;
//             }
//         }
// 
//         throw new NoSuchElementException("unknown client-builder-id: " + id);
//     }
// 
//     public static List<GitLabClientBuilder> getAllGitLabClientBuilders() {
//         List<GitLabClientBuilder> builders = new ArrayList<>(Jenkins.getInstance().getExtensionList(GitLabClientBuilder.class));
//         sort(builders);
//         return builders;
//     }
// 
//     private final String id;
//     private final int ordinal;
// 
//     protected GitLabClientBuilder(String id, int ordinal) {
//         this.id = id;
//         this.ordinal = ordinal;
//     }
// 
//     @NonNull
//     public final String id() {
//         return id;
//     }
// 
//     @NonNull
//     public abstract GitLabClient buildClient(String url, String token, boolean ignoreCertificateErrors, int connectionTimeout, int readTimeout);
// 
//     @Override
//     public final int compareTo(@NonNull GitLabClientBuilder other) {
//         int o = ordinal - other.ordinal;
//         return o != 0 ? o : id().compareTo(other.id());
//     }
// }


import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient;
import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder;
import com.dabsquared.gitlabjenkins.gitlab.api.model.*;
import com.dabsquared.gitlabjenkins.gitlab.hook.model.State;
import javax.ws.rs.NotFoundException;
import java.util.List;
import java.util.NoSuchElementException;
package com.dabsquared.gitlabjenkins.gitlab.api.impl;





final class AutodetectingGitLabClient implements GitLabClient {
    private final Iterable<GitLabClientBuilder> builders;
    private final String url;
    private final String token;
    private final boolean ignoreCertificateErrors;
    private final int connectionTimeout;
    private final int readTimeout;
    private GitLabClient delegate;


    AutodetectingGitLabClient(Iterable<GitLabClientBuilder> builders, String url, String token, boolean ignoreCertificateErrors, int connectionTimeout, int readTimeout) {
        this.builders = builders;
        this.url = url;
        this.token = token;
        this.ignoreCertificateErrors = ignoreCertificateErrors;
        this.connectionTimeout = connectionTimeout;
        this.readTimeout = readTimeout;
    }

// Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClient.java
// public interface GitLabClient {
//     String getHostUrl();
// 
//     Project createProject(String projectName);
// 
//     MergeRequest createMergeRequest(Integer projectId, String sourceBranch, String targetBranch, String title);
// 
//     Project getProject(String projectName);
// 
//     Project updateProject(String projectId, String name, String path);
// 
//     void deleteProject(String projectId);
// 
//     void addProjectHook(String projectId, String url, Boolean pushEvents, Boolean mergeRequestEvents, Boolean noteEvents);
// 
//     void changeBuildStatus(String projectId, String sha, BuildState state, String ref, String context, String targetUrl, String description);
// 
//     void changeBuildStatus(Integer projectId, String sha, BuildState state, String ref, String context, String targetUrl, String description);
// 
//     void getCommit(String projectId, String sha);
// 
//     void acceptMergeRequest(MergeRequest mr, String mergeCommitMessage, Boolean shouldRemoveSourceBranch);
// 
//     void createMergeRequestNote(MergeRequest mr, String body);
// 
//     List<Awardable> getMergeRequestEmoji(MergeRequest mr);
// 
//     void awardMergeRequestEmoji(MergeRequest mr, String name);
// 
//     void deleteMergeRequestEmoji(MergeRequest mr, Integer awardId);
// 
//     List<MergeRequest> getMergeRequests(String projectId, State state, int page, int perPage);
// 
//     List<Branch> getBranches(String projectId);
// 
//     Branch getBranch(String projectId, String branch);
// 
//     User getCurrentUser();
// 
//     User addUser(String email, String username, String name, String password);
// 
//     User updateUser(String userId, String email, String username, String name, String password);
// 
//     List<Label> getLabels(String projectId);
// 
//     List<Pipeline> getPipelines(String projectName);
// }
// 
// Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/GitLabClientBuilder.java
// @Restricted(NoExternalUse.class)
// public abstract class GitLabClientBuilder implements Comparable<GitLabClientBuilder>, ExtensionPoint, Serializable {
//     public static GitLabClientBuilder getGitLabClientBuilderById(String id) {
//         for (GitLabClientBuilder provider : getAllGitLabClientBuilders()) {
//             if (provider.id().equals(id)) {
//                 return provider;
//             }
//         }
// 
//         throw new NoSuchElementException("unknown client-builder-id: " + id);
//     }
// 
//     public static List<GitLabClientBuilder> getAllGitLabClientBuilders() {
//         List<GitLabClientBuilder> builders = new ArrayList<>(Jenkins.getInstance().getExtensionList(GitLabClientBuilder.class));
//         sort(builders);
//         return builders;
//     }
// 
//     private final String id;
//     private final int ordinal;
// 
//     protected GitLabClientBuilder(String id, int ordinal) {
//         this.id = id;
//         this.ordinal = ordinal;
//     }
// 
//     @NonNull
//     public final String id() {
//         return id;
//     }
// 
//     @NonNull
//     public abstract GitLabClient buildClient(String url, String token, boolean ignoreCertificateErrors, int connectionTimeout, int readTimeout);
// 
//     @Override
//     public final int compareTo(@NonNull GitLabClientBuilder other) {
//         int o = ordinal - other.ordinal;
//         return o != 0 ? o : id().compareTo(other.id());
//     }
// }


// Path: src/main/java/com/dabsquared/gitlabjenkins/gitlab/api/impl/AutodetectingGitLabClient.java
import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClient;
import com.dabsquared.gitlabjenkins.gitlab.api.GitLabClientBuilder;
import com.dabsquared.gitlabjenkins.gitlab.api.model.*;
import com.dabsquared.gitlabjenkins.gitlab.hook.model.State;
import javax.ws.rs.NotFoundException;
import java.util.List;
import java.util.NoSuchElementException;

package com.dabsquared.gitlabjenkins.gitlab.api.impl;





final class AutodetectingGitLabClient implements GitLabClient {
    private final Iterable<GitLabClientBuilder> builders;
    private final String url;
    private final String token;
    private final boolean ignoreCertificateErrors;
    private final int connectionTimeout;
    private final int readTimeout;
    private GitLabClient delegate;


    AutodetectingGitLabClient(Iterable<GitLabClientBuilder> builders, String url, String token, boolean ignoreCertificateErrors, int connectionTimeout, int readTimeout) {
        this.builders = builders;
        this.url = url;
        this.token = token;
        this.ignoreCertificateErrors = ignoreCertificateErrors;
        this.connectionTimeout = connectionTimeout;
        this.readTimeout = readTimeout;
    }

    @Override