Implement API layer for publish API method #112

Merged
amalka.subasinghe merged 11 commits from pasindu/device-mgt-core:publisherAPILayer into master 2 years ago

Purpose

The purpose of this PR is to fix https://roadmap.entgra.net/issues/10097

Goals

Implement API layer for publish API method.

Approach

  • Invoke Publisher APIs by using rest api component.

NOTE:

  • WS and dynamic endpoint type APIs are not tested in this pr.
  • Some commented lines were kept because those lines might be used with the ws and dynamic type endpoint API implementations.
### Purpose The purpose of this PR is to fix https://roadmap.entgra.net/issues/10097 ### Goals Implement API layer for publish API method. ### Approach - Invoke Publisher APIs by using rest api component. NOTE: - WS and dynamic endpoint type APIs are not tested in this pr. - Some commented lines were kept because those lines might be used with the ws and dynamic type endpoint API implementations.
pasindu force-pushed publisherAPILayer from 3d7b58d8a5 to 7f4900e5c5 2 years ago
pasindu force-pushed publisherAPILayer from 7f4900e5c5 to 9f1fdae4b1 2 years ago
amalka.subasinghe approved these changes 2 years ago
pasindu force-pushed publisherAPILayer from 9f1fdae4b1 to f7c5513ba4 2 years ago

Now the repo has been restructured. please update your PR

Now the repo has been restructured. please update your PR
pasindu force-pushed publisherAPILayer from f7c5513ba4 to edbcf4eedb 2 years ago
pasindu force-pushed publisherAPILayer from edbcf4eedb to 63aab761b0 2 years ago
pasindu force-pushed publisherAPILayer from 63aab761b0 to 9230a85369 2 years ago
pasindu force-pushed publisherAPILayer from 9230a85369 to e208d46f02 2 years ago
pasindu force-pushed publisherAPILayer from e208d46f02 to d4807b6b11 2 years ago
amalka.subasinghe requested changes 2 years ago
package io.entgra.device.mgt.core.apimgt.extension.rest.api.util.APIUtils;

no licence header, pls check all new classes

no licence header, pls check all new classes
// This will retrieve the un deployed revision list
JSONArray undeployedRevisionList = (JSONArray)
publisherRESTAPIServices.getAPIRevisions(apiApplicationKey, accessTokenInfo,
existingAPI.getString("id"), "?query=deployed:false").get("list");

should pass true or false here and making of real api request should be done in the method it self

should pass true or false here and making of real api request should be done in the method it self
Poster

Fixed with b133f56965

Fixed with https://repository.entgra.net/community/device-mgt-core/commit/b133f569652fd3b0ee307ea6cd893c5025db20e4
amalka.subasinghe reviewed 2 years ago
// api.setKeyManagers(keyManagers);
// api.setEnableStore(true);
// api.setEnableSchemaValidation(false);
// api.setMonetizationEnabled(false);

clean up unwanted code

clean up unwanted code
amalka.subasinghe reviewed 2 years ago
* This class represents the API response.
*/
public class APIResponseUtil {

this is a dto class right? Why name it as APIResponseUtil? Util we use to put utilities
and dto clases should not be placed under util package.

this is a dto class right? Why name it as APIResponseUtil? Util we use to put utilities and dto clases should not be placed under util package.
pasindu force-pushed publisherAPILayer from d4807b6b11 to 7246209bd8 2 years ago
pasindu added 1 commit 2 years ago
pasindu added 1 commit 2 years ago
pasindu changed title from WIP: Implement API layer for publish API method to Implement API layer for publish API method 2 years ago
pasindu requested review from amalka.subasinghe 2 years ago
tcdlpds requested changes 2 years ago
accessTokenInfo = apiApplicationServices.generateAccessTokenFromRegisteredApplication(
apiApplicationKey.getClientId(), apiApplicationKey.getClientSecret());
} catch (APIServicesException e) {
String errorMsg = "Error while generating application";
Owner

Change error message, e.g:- Error occurred while generating the API application.

Change error message, e.g:- Error occurred while generating the API application.
if (apiObj.getString("name").equals(apiIdentifier.getApiName().replace(Constants.SPACE,
Constants.EMPTY_STRING))){
apiFound = true;
apiIdentifier.setUuid(apiObj.getString("id"));
Owner

Don't we need to break the loop when the condition satisfied?

Don't we need to break the loop when the condition satisfied?
JSONArray documentList = (JSONArray) publisherRESTAPIServices.getDocumentations(apiApplicationKey,
accessTokenInfo, api.getId()).get("list");
if (!(documentList.length() == 0)) {
Owner

if (!(documentList.length() == 0)) --> if (documentList.length() > 0)

if (!(documentList.length() == 0)) --> if (documentList.length() > 0)
Poster

Fixed with c5a7902386

Fixed with https://repository.entgra.net/community/device-mgt-core/commit/c5a7902386da8b89f3d3389e0b6b779888e8d1df
pasindu added 1 commit 2 years ago
amalka.subasinghe approved these changes 2 years ago
tcdlpds approved these changes 2 years ago
amalka.subasinghe merged commit 302f62a264 into master 2 years ago

Reviewers

amalka.subasinghe approved these changes 2 years ago
tcdlpds approved these changes 2 years ago
The pull request has been merged as 302f62a264.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: community/device-mgt-core#112
Loading…
There is no content yet.