|
|
@ -644,7 +644,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public MediationPolicy[] getAllApiSpecificMediationPolicies(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo,
|
|
|
|
public MediationPolicy[] getAllApiSpecificMediationPolicies(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo,
|
|
|
|
String apiUuid)
|
|
|
|
String apiUuid)
|
|
|
|
throws APIServicesException, BadRequestException, UnexpectedResponseException {
|
|
|
|
throws APIServicesException, BadRequestException, UnexpectedResponseException {
|
|
|
|
|
|
|
|
|
|
|
|
String getAPIMediationEndPoint = endPointPrefix + Constants.API_ENDPOINT + apiUuid + "/mediation-policies";
|
|
|
|
String getAPIMediationEndPoint = endPointPrefix + Constants.API_ENDPOINT + apiUuid + "/mediation-policies";
|
|
|
@ -815,7 +815,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public APIRevision[] getAPIRevisions(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, String uuid,
|
|
|
|
public APIRevision[] getAPIRevisions(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, String uuid,
|
|
|
|
Boolean deploymentStatus)
|
|
|
|
Boolean deploymentStatus)
|
|
|
|
throws APIServicesException, BadRequestException, UnexpectedResponseException {
|
|
|
|
throws APIServicesException, BadRequestException, UnexpectedResponseException {
|
|
|
|
|
|
|
|
|
|
|
|
String getAPIRevisionsEndPoint = endPointPrefix + Constants.API_ENDPOINT + uuid + "/revisions?query=deployed:"
|
|
|
|
String getAPIRevisionsEndPoint = endPointPrefix + Constants.API_ENDPOINT + uuid + "/revisions?query=deployed:"
|
|
|
@ -1041,7 +1041,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public JSONObject getDocumentations(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, String uuid)
|
|
|
|
public Documentation[] getDocumentations(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, String uuid)
|
|
|
|
throws APIServicesException, BadRequestException, UnexpectedResponseException {
|
|
|
|
throws APIServicesException, BadRequestException, UnexpectedResponseException {
|
|
|
|
|
|
|
|
|
|
|
|
String getDocumentationsEndPoint = endPointPrefix + Constants.API_ENDPOINT + uuid + "/documents?limit=1000";
|
|
|
|
String getDocumentationsEndPoint = endPointPrefix + Constants.API_ENDPOINT + uuid + "/documents?limit=1000";
|
|
|
@ -1056,8 +1056,8 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Response response = client.newCall(request).execute();
|
|
|
|
Response response = client.newCall(request).execute();
|
|
|
|
if (HttpStatus.SC_OK == response.code()) {
|
|
|
|
if (HttpStatus.SC_OK == response.code()) {
|
|
|
|
JSONObject jsonObject = new JSONObject(response.body().string());
|
|
|
|
JSONArray documentList = (JSONArray) new JSONObject(response.body().string()).get("list");
|
|
|
|
return jsonObject;
|
|
|
|
return gson.fromJson(documentList.toString(), Documentation[].class);
|
|
|
|
} else if (HttpStatus.SC_UNAUTHORIZED == response.code()) {
|
|
|
|
} else if (HttpStatus.SC_UNAUTHORIZED == response.code()) {
|
|
|
|
APIApplicationServices apiApplicationServices = new APIApplicationServicesImpl();
|
|
|
|
APIApplicationServices apiApplicationServices = new APIApplicationServicesImpl();
|
|
|
|
AccessTokenInfo refreshedAccessToken = apiApplicationServices.
|
|
|
|
AccessTokenInfo refreshedAccessToken = apiApplicationServices.
|
|
|
@ -1127,17 +1127,16 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
|
|
|
|
|
|
|
|
|
|
|
|
String addNewScope = endPointPrefix + Constants.API_ENDPOINT + uuid + "/documents";
|
|
|
|
String addNewScope = endPointPrefix + Constants.API_ENDPOINT + uuid + "/documents";
|
|
|
|
|
|
|
|
|
|
|
|
String document = "{\n" +
|
|
|
|
JSONObject payload = new JSONObject();
|
|
|
|
" \"name\": \"" + documentation.getName() + "\",\n" +
|
|
|
|
payload.put("name", documentation.getName());
|
|
|
|
" \"type\": \"" + documentation.getType() + "\",\n" +
|
|
|
|
payload.put("type", documentation.getType());
|
|
|
|
" \"summary\": \"" + documentation.getSummary() + "\",\n" +
|
|
|
|
payload.put("summary", documentation.getSummary());
|
|
|
|
" \"sourceType\": \"" + documentation.getSourceType() + "\",\n" +
|
|
|
|
payload.put("sourceType", documentation.getSourceType());
|
|
|
|
" \"inlineContent\": \"" + documentation.getSourceType() + "\",\n" +
|
|
|
|
payload.put("inlineContent", documentation.getSourceType());
|
|
|
|
" \"visibility\": \"" + documentation.getVisibility() + "\",\n" +
|
|
|
|
payload.put("visibility", documentation.getVisibility());
|
|
|
|
" \"createdBy\": \"admin\"\n" +
|
|
|
|
payload.put("createdBy", documentation.getCreatedBy());
|
|
|
|
"}";
|
|
|
|
|
|
|
|
|
|
|
|
RequestBody requestBody = RequestBody.create(JSON, payload.toString());
|
|
|
|
RequestBody requestBody = RequestBody.create(JSON, document);
|
|
|
|
|
|
|
|
Request request = new Request.Builder()
|
|
|
|
Request request = new Request.Builder()
|
|
|
|
.url(addNewScope)
|
|
|
|
.url(addNewScope)
|
|
|
|
.addHeader(Constants.HEADER_CONTENT_TYPE, Constants.APPLICATION_JSON)
|
|
|
|
.addHeader(Constants.HEADER_CONTENT_TYPE, Constants.APPLICATION_JSON)
|
|
|
|