Browse Source

SONAR-19789 add ITs for permission sync upon GitHub onboarding

tags/10.2.0.77647
Aurelien Poscia 9 months ago
parent
commit
3890d518d8

+ 29
- 0
sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/AlmIntegrationsService.java View File

@@ -101,6 +101,35 @@ public class AlmIntegrationsService extends BaseService {
Projects.CreateWsResponse.parser());
}

/**
* This is a POST request.
*
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_integrations/import_github_project">Further information about this action online (including a response example)</a>
*/
public Projects.CreateWsResponse importGithubProject(ImportGithubProjectRequest request) {
return call(
new PostRequest(path("import_github_project"))
.setParam("almSetting", request.getAlmSetting())
.setParam("organization", request.getOrganization())
.setParam("repositoryKey", request.getRepositoryKey())
.setMediaType(MediaTypes.JSON),
Projects.CreateWsResponse.parser());
}

/**
* This is a GET request.
*
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_integrations/list_github_organizations">Further information about this action online (including a response example)</a>
*/
public void listGithubOrganizations(ListGithubOrganizationsRequest request) {
call(
new GetRequest(path("list_github_organizations"))
.setParam("almSetting", request.getAlmSetting())
.setParam("token", request.getToken())
.setMediaType(MediaTypes.JSON),
Projects.CreateWsResponse.parser());
}

/**
* This is part of the internal API.
* This is a POST request.

+ 72
- 0
sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/ImportGithubProjectRequest.java View File

@@ -0,0 +1,72 @@
/*
* SonarQube
* Copyright (C) 2009-2023 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonarqube.ws.client.almintegrations;

/**
* This is part of the internal API.
* This is a POST request.
*
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_integrations/import_github_project">Further information about this action online (including a response example)</a>
*/
public class ImportGithubProjectRequest {

private String almSetting;
private String repositoryKey;

private String organization;

/**
* This is a mandatory parameter.
*/
public ImportGithubProjectRequest setAlmSetting(String almSetting) {
this.almSetting = almSetting;
return this;
}

public String getAlmSetting() {
return almSetting;
}


public String getRepositoryKey() {
return repositoryKey;
}

/**
* This is a mandatory parameter.
*/
public ImportGithubProjectRequest setRepositoryKey(String repositoryKey) {
this.repositoryKey = repositoryKey;
return this;
}

public String getOrganization() {
return organization;
}

/**
* This is a mandatory parameter.
*/
public ImportGithubProjectRequest setOrganization(String organization) {
this.organization = organization;
return this;
}

}

+ 55
- 0
sonar-ws/src/main/java/org/sonarqube/ws/client/almintegrations/ListGithubOrganizationsRequest.java View File

@@ -0,0 +1,55 @@
/*
* SonarQube
* Copyright (C) 2009-2023 SonarSource SA
* mailto:info AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonarqube.ws.client.almintegrations;

/**
* This is part of the internal API.
* This is a GET request.
*
* @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/alm_integrations/list_github_organizations">Further information about this action online (including a response example)</a>
*/
public class ListGithubOrganizationsRequest {

private String almSetting;
private String token;



/**
* This is a mandatory parameter.
*/
public ListGithubOrganizationsRequest setAlmSetting(String almSetting) {
this.almSetting = almSetting;
return this;
}

public String getAlmSetting() {
return almSetting;
}

public String getToken() {
return token;
}

public ListGithubOrganizationsRequest setToken(String token) {
this.token = token;
return this;
}
}

Loading…
Cancel
Save