diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java index 003d672a1f6d..e816b2f541db 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java @@ -3925,6 +3925,11 @@ public Map searchPaginatedContent(String searchQuery, String org api.setContextTemplate(publiserAPI.getContext()); api.setStatus(publiserAPI.getStatus()); api.setBusinessOwner(publiserAPI.getBusinessOwner()); + api.setBusinessOwnerEmail(publiserAPI.getBusinessOwnerEmail()); + api.setTechnicalOwner(publiserAPI.getTechnicalOwner()); + api.setTechnicalOwnerEmail(publiserAPI.getTechnicalOwnerEmail()); + api.setMonetizationEnabled(publiserAPI.getMonetizationStatus()); + api.setAdvertiseOnly(publiserAPI.getAdvertiseOnly()); api.setRating(0);// need to retrieve from db apiSet.add(api); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java index b5257ed9199f..74bbaa33b8a8 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIProviderImpl.java @@ -5179,6 +5179,12 @@ public Map searchPaginatedContent(String searchQuery, String org api.setContextTemplate(publiserAPI.getContext()); api.setStatus(publiserAPI.getStatus()); api.setThumbnailUrl(publiserAPI.getThumbnailUri()); + api.setBusinessOwner(publiserAPI.getBusinessOwner()); + api.setBusinessOwnerEmail(publiserAPI.getBusinessOwnerEmail()); + api.setTechnicalOwner(publiserAPI.getTechnicalOwner()); + api.setTechnicalOwnerEmail(publiserAPI.getTechnicalOwnerEmail()); + api.setMonetizationEnabled(publiserAPI.getMonetizationStatus()); + api.setAdvertiseOnly(publiserAPI.getAdvertiseOnly()); apiSet.add(api); } else if ("APIProduct".equals(item.getType())) { @@ -5189,6 +5195,11 @@ public Map searchPaginatedContent(String searchQuery, String org api.setContextTemplate(publiserAPI.getContext()); api.setState(publiserAPI.getStatus()); api.setThumbnailUrl(publiserAPI.getThumbnailUri()); + api.setBusinessOwner(publiserAPI.getBusinessOwner()); + api.setBusinessOwnerEmail(publiserAPI.getBusinessOwnerEmail()); + api.setTechnicalOwner(publiserAPI.getTechnicalOwner()); + api.setTechnicalOwnerEmail(publiserAPI.getTechnicalOwnerEmail()); + api.setMonetizationEnabled(publiserAPI.getMonetizationStatus()); apiProductSet.add(api); } else if (item instanceof DocumentSearchContent) { // doc item @@ -5337,6 +5348,11 @@ public Map searchPaginatedAPIProducts(String searchQuery, String mappedAPI.setContext(publisherAPIInfo.getContext()); mappedAPI.setApiSecurity(publisherAPIInfo.getApiSecurity()); mappedAPI.setThumbnailUrl(publisherAPIInfo.getThumbnail()); + mappedAPI.setBusinessOwner(publisherAPIInfo.getBusinessOwner()); + mappedAPI.setBusinessOwnerEmail(publisherAPIInfo.getBusinessOwnerEmail()); + mappedAPI.setTechnicalOwner(publisherAPIInfo.getTechnicalOwner()); + mappedAPI.setTechnicalOwnerEmail(publisherAPIInfo.getTechnicalOwnerEmail()); + mappedAPI.setMonetizationEnabled(publisherAPIInfo.getMonetizationStatus()); populateAPIStatus(mappedAPI); productList.add(mappedAPI); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java index 370f0fe011f9..f567d2896037 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/RegistryPersistenceImpl.java @@ -979,6 +979,12 @@ private PublisherAPISearchResult searchPaginatedPublisherAPIs(Registry userRegis apiInfo.setGatewayVendor(String.valueOf(artifact.getAttribute(APIConstants.API_OVERVIEW_GATEWAY_VENDOR))); apiInfo.setAdvertiseOnly(Boolean.parseBoolean(artifact .getAttribute(APIConstants.API_OVERVIEW_ADVERTISE_ONLY))); + apiInfo.setBusinessOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER)); + apiInfo.setBusinessOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL)); + apiInfo.setTechnicalOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER)); + apiInfo.setTechnicalOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL)); + apiInfo.setMonetizationStatus(Boolean.parseBoolean(artifact. + getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS))); publisherAPIInfoList.add(apiInfo); // Ensure the APIs returned matches the length, there could be an additional API @@ -1094,6 +1100,9 @@ private DevPortalAPISearchResult searchPaginatedDevPortalAPIs(Registry userRegis apiInfo.setStatus(artifact.getAttribute(APIConstants.API_OVERVIEW_STATUS)); apiInfo.setThumbnail(artifact.getAttribute(APIConstants.API_OVERVIEW_THUMBNAIL_URL)); apiInfo.setBusinessOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER)); + apiInfo.setBusinessOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL)); + apiInfo.setTechnicalOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER)); + apiInfo.setTechnicalOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL)); apiInfo.setVersion(artifact.getAttribute(APIConstants.API_OVERVIEW_VERSION)); String tiers = artifact.getAttribute(APIConstants.API_OVERVIEW_TIER); Set availableTiers = new HashSet(); @@ -1109,6 +1118,10 @@ private DevPortalAPISearchResult searchPaginatedDevPortalAPIs(Registry userRegis apiInfo.setSubscriptionAvailableOrgs( artifact.getAttribute(APIConstants.API_OVERVIEW_SUBSCRIPTION_AVAILABLE_TENANTS)); apiInfo.setGatewayVendor(artifact.getAttribute(APIConstants.API_OVERVIEW_GATEWAY_VENDOR)); + apiInfo.setMonetizationStatus(Boolean.parseBoolean(artifact. + getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS))); + apiInfo.setAdvertiseOnly(Boolean.parseBoolean(artifact + .getAttribute(APIConstants.API_OVERVIEW_ADVERTISE_ONLY))); devPortalAPIInfoList.add(apiInfo); // Ensure the APIs returned matches the length, there could be an additional API @@ -1223,6 +1236,15 @@ private DevPortalAPISearchResult searchPaginatedDevPortalAPIsByDoc(Registry regi apiInfo.setSubscriptionAvailableOrgs(artifact .getAttribute(APIConstants.API_OVERVIEW_SUBSCRIPTION_AVAILABLE_TENANTS)); apiInfo.setGatewayVendor(artifact.getAttribute(APIConstants.API_OVERVIEW_GATEWAY_VENDOR)); + apiInfo.setAdvertiseOnly(Boolean.parseBoolean(artifact + .getAttribute(APIConstants.API_OVERVIEW_ADVERTISE_ONLY))); + apiInfo.setBusinessOwnerEmail(artifact. + getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL)); + apiInfo.setTechnicalOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER)); + apiInfo.setTechnicalOwnerEmail(artifact. + getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL)); + apiInfo.setMonetizationStatus(Boolean.parseBoolean(artifact. + getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS))); devPortalAPIInfoList.add(apiInfo); } @@ -1338,6 +1360,14 @@ private PublisherAPISearchResult searchPaginatedPublisherAPIsByDoc(Registry regi apiInfo.setVersion(artifact.getAttribute(APIConstants.API_OVERVIEW_VERSION)); apiInfo.setAdvertiseOnly(Boolean.parseBoolean(artifact .getAttribute(APIConstants.API_OVERVIEW_ADVERTISE_ONLY))); + apiInfo.setBusinessOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER)); + apiInfo.setBusinessOwnerEmail(artifact. + getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL)); + apiInfo.setTechnicalOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER)); + apiInfo.setTechnicalOwnerEmail(artifact. + getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL)); + apiInfo.setMonetizationStatus(Boolean.parseBoolean(artifact. + getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS))); publisherAPIInfoList.add(apiInfo); } @@ -1508,6 +1538,11 @@ public PublisherContentSearchResult searchContentForPublisher(Organization org, content.setStatus(pubAPI.getStatus()); content.setAdvertiseOnly(pubAPI.isAdvertiseOnly()); content.setThumbnailUri(pubAPI.getThumbnail()); + content.setBusinessOwner(pubAPI.getBusinessOwner()); + content.setBusinessOwnerEmail(pubAPI.getBusinessOwnerEmail()); + content.setTechnicalOwner(pubAPI.getTechnicalOwner()); + content.setTechnicalOwnerEmail(pubAPI.getTechnicalOwnerEmail()); + content.setMonetizationStatus(pubAPI.getMonetizationStatus()); contentData.add(content); } else { throw new GovernanceException("artifact id is null for " + resourcePath); @@ -1646,6 +1681,11 @@ public DevPortalContentSearchResult searchContentForDevPortal(Organization org, content.setStatus(devAPI.getStatus()); content.setBusinessOwner(devAPI.getBusinessOwner()); content.setBusinessOwnerEmail(devAPI.getBusinessOwnerEmail()); + content.setBusinessOwnerEmail(devAPI.getBusinessOwnerEmail()); + content.setTechnicalOwner(devAPI.getTechnicalOwner()); + content.setTechnicalOwnerEmail(devAPI.getTechnicalOwnerEmail()); + content.setMonetizationStatus(devAPI.getMonetizationStatus()); + content.setAdvertiseOnly(devAPI.isAdvertiseOnly()); contentData.add(content); } else { @@ -3303,6 +3343,12 @@ public PublisherAPIProductSearchResult searchAPIProductsForPublisher(Organizatio info.setVersion(artifact.getAttribute(APIConstants.API_OVERVIEW_VERSION)); info.setApiSecurity(artifact.getAttribute(APIConstants.API_OVERVIEW_API_SECURITY)); info.setThumbnail(artifact.getAttribute(APIConstants.API_OVERVIEW_THUMBNAIL_URL)); + info.setBusinessOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER)); + info.setBusinessOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL)); + info.setTechnicalOwner(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER)); + info.setTechnicalOwnerEmail(artifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL)); + info.setMonetizationStatus(Boolean.parseBoolean(artifact. + getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS))); publisherAPIProductInfoList.add(info); diff --git a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/DevPortalAPIInfo.java b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/DevPortalAPIInfo.java index 54ccd8746176..4b0c8fd2ad9c 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/DevPortalAPIInfo.java +++ b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/DevPortalAPIInfo.java @@ -40,6 +40,11 @@ public class DevPortalAPIInfo { private String description; private String gatewayVendor; private Map additionalProperties; + private String businessOwnerEmail; + private String technicalOwner; + private String technicalOwnerEmail; + private Boolean isMonetizationEnabled; + private boolean advertiseOnly; public void setGatewayVendor(String gatewayVendor) { this.gatewayVendor = gatewayVendor; @@ -145,13 +150,56 @@ public void setAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; } + public String getBusinessOwnerEmail() { + return businessOwnerEmail; + } + + public void setBusinessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + } + + public String getTechnicalOwner() { + return technicalOwner; + } + + public void setTechnicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + } + + public String getTechnicalOwnerEmail() { + return technicalOwnerEmail; + } + + public void setTechnicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + } + + public Boolean getMonetizationStatus() { + return isMonetizationEnabled; + } + + public void setMonetizationStatus(Boolean isMonetizationEnabled) { + this.isMonetizationEnabled = isMonetizationEnabled; + } + + public boolean isAdvertiseOnly() { + return advertiseOnly; + } + + public void setAdvertiseOnly(boolean advertiseOnly) { + this.advertiseOnly = advertiseOnly; + } + @Override public String toString() { return "DevPortalAPIInfo [id=" + id + ", apiName=" + apiName + ", description=" + description + ", version=" + version + ", providerName=" + providerName + ", context=" + context + ", type=" + type + ", " + - "thumbnail=" + thumbnail + ", businessOwner=" + businessOwner + ", status=" + status + ", " + - "availableTierNames=" + availableTierNames + ", subscriptionAvailability=" + subscriptionAvailability - + ", subscriptionAvailableOrgs=" + subscriptionAvailableOrgs + "]"; + "thumbnail=" + thumbnail + ", businessOwner=" + businessOwner + ", businessOwnerEmail=" + + businessOwnerEmail + ", technicalOwner=" + technicalOwner + ", technicalOwnerEmail=" + + technicalOwnerEmail + ", status=" + status + ", " + "availableTierNames=" + availableTierNames + + ", subscriptionAvailability=" + subscriptionAvailability + ", subscriptionAvailableOrgs=" + + subscriptionAvailableOrgs + ", isMonetizationEnabled=" + isMonetizationEnabled + ", advertiseOnly=" + + advertiseOnly +"]"; } } diff --git a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/DevPortalSearchContent.java b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/DevPortalSearchContent.java index e0a21d926043..51bbcd347034 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/DevPortalSearchContent.java +++ b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/DevPortalSearchContent.java @@ -32,6 +32,8 @@ public class DevPortalSearchContent implements SearchContent { String technicalOwner; String technicalOwnerEmail; String avgRating; + Boolean isMonetizationEnabled; + Boolean advertiseOnly; @Override public String getId() { @@ -155,4 +157,20 @@ public void setAvgRating(String avgRating) { this.avgRating = avgRating; } + public Boolean getAdvertiseOnly() { + return advertiseOnly; + } + + public void setAdvertiseOnly(Boolean advertiseOnly) { + this.advertiseOnly = advertiseOnly; + } + + public Boolean getMonetizationStatus() { + return isMonetizationEnabled; + } + + public void setMonetizationStatus(Boolean isMonetizationEnabled) { + this.isMonetizationEnabled = isMonetizationEnabled; + } + } diff --git a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherAPIInfo.java b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherAPIInfo.java index f12adf886771..19fffb092585 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherAPIInfo.java +++ b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherAPIInfo.java @@ -43,6 +43,11 @@ public class PublisherAPIInfo { private String gatewayVendor; private boolean advertiseOnly; private String updatedBy; + private String businessOwner; + private String businessOwnerEmail; + private String technicalOwner; + private String technicalOwnerEmail; + private Boolean isMonetizationEnabled; public String getAudience() { return audience; @@ -156,11 +161,53 @@ public void setAdvertiseOnly(boolean advertiseOnly) { this.advertiseOnly = advertiseOnly; } + public String getBusinessOwner() { + return businessOwner; + } + + public void setBusinessOwner(String businessOwner) { + this.businessOwner = businessOwner; + } + + public String getBusinessOwnerEmail() { + return businessOwnerEmail; + } + + public void setBusinessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + } + + public String getTechnicalOwner() { + return technicalOwner; + } + + public void setTechnicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + } + + public String getTechnicalOwnerEmail() { + return technicalOwnerEmail; + } + + public void setTechnicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + } + + public Boolean getMonetizationStatus() { + return isMonetizationEnabled; + } + + public void setMonetizationStatus(Boolean isMonetizationEnabled) { + this.isMonetizationEnabled = isMonetizationEnabled; + } + @Override public String toString() { return "PublisherAPIInfo [id=" + id + ", apiName=" + apiName + ", description=" + description + ", version=" + version + ", providerName=" + providerName + ", context=" + context + ", status=" + status + ", type=" - + type + ", thumbnail=" + thumbnail + ", advertiseOnly=" + advertiseOnly + "]"; + + type + ", thumbnail=" + thumbnail + ", advertiseOnly=" + advertiseOnly + ", businessOwner=" + + businessOwner + ", businessOwnerEmail=" + businessOwnerEmail + ", technicalOwner=" + technicalOwner + + ", technicalOwnerEmail=" + technicalOwnerEmail + ", isMonetizationEnabled=" + isMonetizationEnabled +"]"; } public Map getAdditionalProperties() { diff --git a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherAPIProductInfo.java b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherAPIProductInfo.java index 40014f14b9a2..cb139b2d6078 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherAPIProductInfo.java +++ b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherAPIProductInfo.java @@ -33,6 +33,11 @@ public class PublisherAPIProductInfo { private String type; private String apiSecurity; private String thumbnail; + private String businessOwner; + private String businessOwnerEmail; + private String technicalOwner; + private String technicalOwnerEmail; + private Boolean isMonetizationEnabled; public String getThumbnail() { return thumbnail; } @@ -88,5 +93,34 @@ public void setApiSecurity(String apiSecurity) { this.apiSecurity = apiSecurity; } private String gatewayVendor; - + public String getBusinessOwner() { + return businessOwner; + } + public void setBusinessOwner(String businessOwner) { + this.businessOwner = businessOwner; + } + public String getBusinessOwnerEmail() { + return businessOwnerEmail; + } + public void setBusinessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + } + public String getTechnicalOwner() { + return technicalOwner; + } + public void setTechnicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + } + public String getTechnicalOwnerEmail() { + return technicalOwnerEmail; + } + public void setTechnicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + } + public Boolean getMonetizationStatus() { + return isMonetizationEnabled; + } + public void setMonetizationStatus(Boolean isMonetizationEnabled) { + this.isMonetizationEnabled = isMonetizationEnabled; + } } diff --git a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherSearchContent.java b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherSearchContent.java index a3b0102881c3..8e6193dafebd 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherSearchContent.java +++ b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/dto/PublisherSearchContent.java @@ -28,6 +28,11 @@ public class PublisherSearchContent implements SearchContent { String status; String thumbnailUri; Boolean advertiseOnly; + String businessOwner; + String businessOwnerEmail; + String technicalOwner; + String technicalOwnerEmail; + Boolean isMonetizationEnabled; @Override public String getId() { @@ -118,4 +123,44 @@ public Boolean getAdvertiseOnly() { public void setAdvertiseOnly(Boolean advertiseOnly) { this.advertiseOnly = advertiseOnly; } + + public String getBusinessOwner() { + return businessOwner; + } + + public void setBusinessOwner(String businessOwner) { + this.businessOwner = businessOwner; + } + + public String getBusinessOwnerEmail() { + return businessOwnerEmail; + } + + public void setBusinessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + } + + public String getTechnicalOwner() { + return technicalOwner; + } + + public void setTechnicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + } + + public String getTechnicalOwnerEmail() { + return technicalOwnerEmail; + } + + public void setTechnicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + } + + public Boolean getMonetizationStatus() { + return isMonetizationEnabled; + } + + public void setMonetizationStatus(Boolean isMonetizationEnabled) { + this.isMonetizationEnabled = isMonetizationEnabled; + } } diff --git a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/utils/RegistryPersistenceUtil.java b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/utils/RegistryPersistenceUtil.java index 87c63b4a38b0..67bd67eb6aa7 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/utils/RegistryPersistenceUtil.java +++ b/components/apimgt/org.wso2.carbon.apimgt.persistence/src/main/java/org/wso2/carbon/apimgt/persistence/utils/RegistryPersistenceUtil.java @@ -1389,6 +1389,12 @@ public static PublisherAPI getAPIForSearch(GenericArtifact apiArtifact) throws A api.setAdvertiseOnly(Boolean.parseBoolean(apiArtifact .getAttribute(APIConstants.API_OVERVIEW_ADVERTISE_ONLY))); api.setThumbnail(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_THUMBNAIL_URL)); + api.setBusinessOwner(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER)); + api.setBusinessOwnerEmail(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL)); + api.setTechnicalOwner(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER)); + api.setTechnicalOwnerEmail(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL)); + api.setMonetizationStatus(Boolean.parseBoolean(apiArtifact. + getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS))); } catch (GovernanceException e) { throw new APIPersistenceException("Error while extracting api attributes ", e); @@ -1408,6 +1414,13 @@ public static DevPortalAPI getDevPortalAPIForSearch(GenericArtifact apiArtifact) api.setProviderName(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_PROVIDER)); api.setVersion(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_VERSION)); api.setBusinessOwner(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER)); + api.setBusinessOwnerEmail(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_BUSS_OWNER_EMAIL)); + api.setTechnicalOwner(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER)); + api.setTechnicalOwnerEmail(apiArtifact.getAttribute(APIConstants.API_OVERVIEW_TEC_OWNER_EMAIL)); + api.setMonetizationStatus(Boolean.parseBoolean(apiArtifact. + getAttribute(APIConstants.Monetization.API_MONETIZATION_STATUS))); + api.setAdvertiseOnly(Boolean.parseBoolean(apiArtifact + .getAttribute(APIConstants.API_OVERVIEW_ADVERTISE_ONLY))); } catch (GovernanceException e) { throw new APIPersistenceException("Error while extracting api attributes ", e); diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIInfoDTO.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIInfoDTO.java index e19c3712dcd2..a7c45c7e3299 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIInfoDTO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIInfoDTO.java @@ -76,6 +76,11 @@ public static AudienceEnum fromValue(String v) { private String updatedBy = null; private String gatewayVendor = null; private Boolean advertiseOnly = null; + private Boolean monetizedInfo = null; + private String businessOwner = null; + private String businessOwnerEmail = null; + private String technicalOwner = null; + private String technicalOwnerEmail = null; /** **/ @@ -405,6 +410,91 @@ public void setAdvertiseOnly(Boolean advertiseOnly) { this.advertiseOnly = advertiseOnly; } + /** + **/ + public APIInfoDTO monetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("monetizedInfo") + public Boolean isMonetizedInfo() { + return monetizedInfo; + } + public void setMonetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + } + + /** + **/ + public APIInfoDTO businessOwner(String businessOwner) { + this.businessOwner = businessOwner; + return this; + } + + + @ApiModelProperty(example = "Business Owner", value = "") + @JsonProperty("businessOwner") + public String getBusinessOwner() { + return businessOwner; + } + public void setBusinessOwner(String businessOwner) { + this.businessOwner = businessOwner; + } + + /** + **/ + public APIInfoDTO businessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "businessowner@abc.com", value = "") + @JsonProperty("businessOwnerEmail") + public String getBusinessOwnerEmail() { + return businessOwnerEmail; + } + public void setBusinessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + } + + /** + **/ + public APIInfoDTO technicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + return this; + } + + + @ApiModelProperty(example = "Technical Owner", value = "") + @JsonProperty("TechnicalOwner") + public String getTechnicalOwner() { + return technicalOwner; + } + public void setTechnicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + } + + /** + **/ + public APIInfoDTO technicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "technicalowner@abc.com", value = "") + @JsonProperty("TechnicalOwnerEmail") + public String getTechnicalOwnerEmail() { + return technicalOwnerEmail; + } + public void setTechnicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + } + @Override public boolean equals(java.lang.Object o) { @@ -433,12 +523,17 @@ public boolean equals(java.lang.Object o) { Objects.equals(updatedTime, apIInfo.updatedTime) && Objects.equals(updatedBy, apIInfo.updatedBy) && Objects.equals(gatewayVendor, apIInfo.gatewayVendor) && - Objects.equals(advertiseOnly, apIInfo.advertiseOnly); + Objects.equals(advertiseOnly, apIInfo.advertiseOnly) && + Objects.equals(monetizedInfo, apIInfo.monetizedInfo) && + Objects.equals(businessOwner, apIInfo.businessOwner) && + Objects.equals(businessOwnerEmail, apIInfo.businessOwnerEmail) && + Objects.equals(technicalOwner, apIInfo.technicalOwner) && + Objects.equals(technicalOwnerEmail, apIInfo.technicalOwnerEmail); } @Override public int hashCode() { - return Objects.hash(id, name, description, context, additionalProperties, additionalPropertiesMap, version, provider, type, audience, lifeCycleStatus, workflowStatus, hasThumbnail, securityScheme, createdTime, updatedTime, updatedBy, gatewayVendor, advertiseOnly); + return Objects.hash(id, name, description, context, additionalProperties, additionalPropertiesMap, version, provider, type, audience, lifeCycleStatus, workflowStatus, hasThumbnail, securityScheme, createdTime, updatedTime, updatedBy, gatewayVendor, advertiseOnly, monetizedInfo, businessOwner, businessOwnerEmail, technicalOwner, technicalOwnerEmail); } @Override @@ -465,6 +560,11 @@ public String toString() { sb.append(" updatedBy: ").append(toIndentedString(updatedBy)).append("\n"); sb.append(" gatewayVendor: ").append(toIndentedString(gatewayVendor)).append("\n"); sb.append(" advertiseOnly: ").append(toIndentedString(advertiseOnly)).append("\n"); + sb.append(" monetizedInfo: ").append(toIndentedString(monetizedInfo)).append("\n"); + sb.append(" businessOwner: ").append(toIndentedString(businessOwner)).append("\n"); + sb.append(" businessOwnerEmail: ").append(toIndentedString(businessOwnerEmail)).append("\n"); + sb.append(" technicalOwner: ").append(toIndentedString(technicalOwner)).append("\n"); + sb.append(" technicalOwnerEmail: ").append(toIndentedString(technicalOwnerEmail)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductInfoDTO.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductInfoDTO.java index 2f6c139087b3..836ca1083f53 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductInfoDTO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductInfoDTO.java @@ -31,6 +31,11 @@ public class APIProductInfoDTO { private String state = null; private List securityScheme = new ArrayList(); private String gatewayVendor = null; + private Boolean monetizedInfo = null; + private String businessOwner = null; + private String businessOwnerEmail = null; + private String technicalOwner = null; + private String technicalOwnerEmail = null; /** * UUID of the api product @@ -191,6 +196,91 @@ public void setGatewayVendor(String gatewayVendor) { this.gatewayVendor = gatewayVendor; } + /** + **/ + public APIProductInfoDTO monetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("monetizedInfo") + public Boolean isMonetizedInfo() { + return monetizedInfo; + } + public void setMonetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + } + + /** + **/ + public APIProductInfoDTO businessOwner(String businessOwner) { + this.businessOwner = businessOwner; + return this; + } + + + @ApiModelProperty(example = "Business Owner", value = "") + @JsonProperty("businessOwner") + public String getBusinessOwner() { + return businessOwner; + } + public void setBusinessOwner(String businessOwner) { + this.businessOwner = businessOwner; + } + + /** + **/ + public APIProductInfoDTO businessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "businessowner@abc.com", value = "") + @JsonProperty("businessOwnerEmail") + public String getBusinessOwnerEmail() { + return businessOwnerEmail; + } + public void setBusinessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + } + + /** + **/ + public APIProductInfoDTO technicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + return this; + } + + + @ApiModelProperty(example = "Technical Owner", value = "") + @JsonProperty("TechnicalOwner") + public String getTechnicalOwner() { + return technicalOwner; + } + public void setTechnicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + } + + /** + **/ + public APIProductInfoDTO technicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "technicalowner@abc.com", value = "") + @JsonProperty("TechnicalOwnerEmail") + public String getTechnicalOwnerEmail() { + return technicalOwnerEmail; + } + public void setTechnicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + } + @Override public boolean equals(java.lang.Object o) { @@ -209,12 +299,17 @@ public boolean equals(java.lang.Object o) { Objects.equals(hasThumbnail, apIProductInfo.hasThumbnail) && Objects.equals(state, apIProductInfo.state) && Objects.equals(securityScheme, apIProductInfo.securityScheme) && - Objects.equals(gatewayVendor, apIProductInfo.gatewayVendor); + Objects.equals(gatewayVendor, apIProductInfo.gatewayVendor) && + Objects.equals(monetizedInfo, apIProductInfo.monetizedInfo) && + Objects.equals(businessOwner, apIProductInfo.businessOwner) && + Objects.equals(businessOwnerEmail, apIProductInfo.businessOwnerEmail) && + Objects.equals(technicalOwner, apIProductInfo.technicalOwner) && + Objects.equals(technicalOwnerEmail, apIProductInfo.technicalOwnerEmail); } @Override public int hashCode() { - return Objects.hash(id, name, context, description, provider, hasThumbnail, state, securityScheme, gatewayVendor); + return Objects.hash(id, name, context, description, provider, hasThumbnail, state, securityScheme, gatewayVendor, monetizedInfo, businessOwner, businessOwnerEmail, technicalOwner, technicalOwnerEmail); } @Override @@ -231,6 +326,11 @@ public String toString() { sb.append(" state: ").append(toIndentedString(state)).append("\n"); sb.append(" securityScheme: ").append(toIndentedString(securityScheme)).append("\n"); sb.append(" gatewayVendor: ").append(toIndentedString(gatewayVendor)).append("\n"); + sb.append(" monetizedInfo: ").append(toIndentedString(monetizedInfo)).append("\n"); + sb.append(" businessOwner: ").append(toIndentedString(businessOwner)).append("\n"); + sb.append(" businessOwnerEmail: ").append(toIndentedString(businessOwnerEmail)).append("\n"); + sb.append(" technicalOwner: ").append(toIndentedString(technicalOwner)).append("\n"); + sb.append(" technicalOwnerEmail: ").append(toIndentedString(technicalOwnerEmail)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductSearchResultAllOfDTO.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductSearchResultAllOfDTO.java index b55e03f8fb5b..2cf4eea03f6a 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductSearchResultAllOfDTO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductSearchResultAllOfDTO.java @@ -27,6 +27,11 @@ public class APIProductSearchResultAllOfDTO { private String status = null; private String thumbnailUri = null; private Boolean hasThumbnail = null; + private Boolean monetizedInfo = null; + private String businessOwner = null; + private String businessOwnerEmail = null; + private String technicalOwner = null; + private String technicalOwnerEmail = null; /** * A brief description about the API @@ -152,6 +157,91 @@ public void setHasThumbnail(Boolean hasThumbnail) { this.hasThumbnail = hasThumbnail; } + /** + **/ + public APIProductSearchResultAllOfDTO monetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("monetizedInfo") + public Boolean isMonetizedInfo() { + return monetizedInfo; + } + public void setMonetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + } + + /** + **/ + public APIProductSearchResultAllOfDTO businessOwner(String businessOwner) { + this.businessOwner = businessOwner; + return this; + } + + + @ApiModelProperty(example = "Business Owner", value = "") + @JsonProperty("businessOwner") + public String getBusinessOwner() { + return businessOwner; + } + public void setBusinessOwner(String businessOwner) { + this.businessOwner = businessOwner; + } + + /** + **/ + public APIProductSearchResultAllOfDTO businessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "businessowner@abc.com", value = "") + @JsonProperty("businessOwnerEmail") + public String getBusinessOwnerEmail() { + return businessOwnerEmail; + } + public void setBusinessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + } + + /** + **/ + public APIProductSearchResultAllOfDTO technicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + return this; + } + + + @ApiModelProperty(example = "Technical Owner", value = "") + @JsonProperty("TechnicalOwner") + public String getTechnicalOwner() { + return technicalOwner; + } + public void setTechnicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + } + + /** + **/ + public APIProductSearchResultAllOfDTO technicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "technicalowner@abc.com", value = "") + @JsonProperty("TechnicalOwnerEmail") + public String getTechnicalOwnerEmail() { + return technicalOwnerEmail; + } + public void setTechnicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + } + @Override public boolean equals(java.lang.Object o) { @@ -168,12 +258,17 @@ public boolean equals(java.lang.Object o) { Objects.equals(provider, apIProductSearchResultAllOf.provider) && Objects.equals(status, apIProductSearchResultAllOf.status) && Objects.equals(thumbnailUri, apIProductSearchResultAllOf.thumbnailUri) && - Objects.equals(hasThumbnail, apIProductSearchResultAllOf.hasThumbnail); + Objects.equals(hasThumbnail, apIProductSearchResultAllOf.hasThumbnail) && + Objects.equals(monetizedInfo, apIProductSearchResultAllOf.monetizedInfo) && + Objects.equals(businessOwner, apIProductSearchResultAllOf.businessOwner) && + Objects.equals(businessOwnerEmail, apIProductSearchResultAllOf.businessOwnerEmail) && + Objects.equals(technicalOwner, apIProductSearchResultAllOf.technicalOwner) && + Objects.equals(technicalOwnerEmail, apIProductSearchResultAllOf.technicalOwnerEmail); } @Override public int hashCode() { - return Objects.hash(description, context, version, provider, status, thumbnailUri, hasThumbnail); + return Objects.hash(description, context, version, provider, status, thumbnailUri, hasThumbnail, monetizedInfo, businessOwner, businessOwnerEmail, technicalOwner, technicalOwnerEmail); } @Override @@ -188,6 +283,11 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" thumbnailUri: ").append(toIndentedString(thumbnailUri)).append("\n"); sb.append(" hasThumbnail: ").append(toIndentedString(hasThumbnail)).append("\n"); + sb.append(" monetizedInfo: ").append(toIndentedString(monetizedInfo)).append("\n"); + sb.append(" businessOwner: ").append(toIndentedString(businessOwner)).append("\n"); + sb.append(" businessOwnerEmail: ").append(toIndentedString(businessOwnerEmail)).append("\n"); + sb.append(" technicalOwner: ").append(toIndentedString(technicalOwner)).append("\n"); + sb.append(" technicalOwnerEmail: ").append(toIndentedString(technicalOwnerEmail)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductSearchResultDTO.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductSearchResultDTO.java index 9bc3a9b867c3..2a13ac7b54f1 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductSearchResultDTO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APIProductSearchResultDTO.java @@ -29,6 +29,11 @@ public class APIProductSearchResultDTO extends SearchResultDTO { private String status = null; private String thumbnailUri = null; private Boolean hasThumbnail = null; + private Boolean monetizedInfo = null; + private String businessOwner = null; + private String businessOwnerEmail = null; + private String technicalOwner = null; + private String technicalOwnerEmail = null; /** * A brief description about the API @@ -154,6 +159,91 @@ public void setHasThumbnail(Boolean hasThumbnail) { this.hasThumbnail = hasThumbnail; } + /** + **/ + public APIProductSearchResultDTO monetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("monetizedInfo") + public Boolean isMonetizedInfo() { + return monetizedInfo; + } + public void setMonetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + } + + /** + **/ + public APIProductSearchResultDTO businessOwner(String businessOwner) { + this.businessOwner = businessOwner; + return this; + } + + + @ApiModelProperty(example = "Business Owner", value = "") + @JsonProperty("businessOwner") + public String getBusinessOwner() { + return businessOwner; + } + public void setBusinessOwner(String businessOwner) { + this.businessOwner = businessOwner; + } + + /** + **/ + public APIProductSearchResultDTO businessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "businessowner@abc.com", value = "") + @JsonProperty("businessOwnerEmail") + public String getBusinessOwnerEmail() { + return businessOwnerEmail; + } + public void setBusinessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + } + + /** + **/ + public APIProductSearchResultDTO technicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + return this; + } + + + @ApiModelProperty(example = "Technical Owner", value = "") + @JsonProperty("TechnicalOwner") + public String getTechnicalOwner() { + return technicalOwner; + } + public void setTechnicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + } + + /** + **/ + public APIProductSearchResultDTO technicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "technicalowner@abc.com", value = "") + @JsonProperty("TechnicalOwnerEmail") + public String getTechnicalOwnerEmail() { + return technicalOwnerEmail; + } + public void setTechnicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + } + @Override public boolean equals(java.lang.Object o) { @@ -170,12 +260,17 @@ public boolean equals(java.lang.Object o) { Objects.equals(provider, apIProductSearchResult.provider) && Objects.equals(status, apIProductSearchResult.status) && Objects.equals(thumbnailUri, apIProductSearchResult.thumbnailUri) && - Objects.equals(hasThumbnail, apIProductSearchResult.hasThumbnail); + Objects.equals(hasThumbnail, apIProductSearchResult.hasThumbnail) && + Objects.equals(monetizedInfo, apIProductSearchResult.monetizedInfo) && + Objects.equals(businessOwner, apIProductSearchResult.businessOwner) && + Objects.equals(businessOwnerEmail, apIProductSearchResult.businessOwnerEmail) && + Objects.equals(technicalOwner, apIProductSearchResult.technicalOwner) && + Objects.equals(technicalOwnerEmail, apIProductSearchResult.technicalOwnerEmail); } @Override public int hashCode() { - return Objects.hash(description, context, version, provider, status, thumbnailUri, hasThumbnail); + return Objects.hash(description, context, version, provider, status, thumbnailUri, hasThumbnail, monetizedInfo, businessOwner, businessOwnerEmail, technicalOwner, technicalOwnerEmail); } @Override @@ -190,6 +285,11 @@ public String toString() { sb.append(" status: ").append(toIndentedString(status)).append("\n"); sb.append(" thumbnailUri: ").append(toIndentedString(thumbnailUri)).append("\n"); sb.append(" hasThumbnail: ").append(toIndentedString(hasThumbnail)).append("\n"); + sb.append(" monetizedInfo: ").append(toIndentedString(monetizedInfo)).append("\n"); + sb.append(" businessOwner: ").append(toIndentedString(businessOwner)).append("\n"); + sb.append(" businessOwnerEmail: ").append(toIndentedString(businessOwnerEmail)).append("\n"); + sb.append(" technicalOwner: ").append(toIndentedString(technicalOwner)).append("\n"); + sb.append(" technicalOwnerEmail: ").append(toIndentedString(technicalOwnerEmail)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APISearchResultAllOfDTO.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APISearchResultAllOfDTO.java index a5902538679d..1ad65d0131f1 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APISearchResultAllOfDTO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APISearchResultAllOfDTO.java @@ -29,6 +29,11 @@ public class APISearchResultAllOfDTO { private String thumbnailUri = null; private Boolean advertiseOnly = null; private Boolean hasThumbnail = null; + private Boolean monetizedInfo = null; + private String businessOwner = null; + private String businessOwnerEmail = null; + private String technicalOwner = null; + private String technicalOwnerEmail = null; /** * A brief description about the API @@ -189,6 +194,91 @@ public void setHasThumbnail(Boolean hasThumbnail) { this.hasThumbnail = hasThumbnail; } + /** + **/ + public APISearchResultAllOfDTO monetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("monetizedInfo") + public Boolean isMonetizedInfo() { + return monetizedInfo; + } + public void setMonetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + } + + /** + **/ + public APISearchResultAllOfDTO businessOwner(String businessOwner) { + this.businessOwner = businessOwner; + return this; + } + + + @ApiModelProperty(example = "Business Owner", value = "") + @JsonProperty("businessOwner") + public String getBusinessOwner() { + return businessOwner; + } + public void setBusinessOwner(String businessOwner) { + this.businessOwner = businessOwner; + } + + /** + **/ + public APISearchResultAllOfDTO businessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "businessowner@abc.com", value = "") + @JsonProperty("businessOwnerEmail") + public String getBusinessOwnerEmail() { + return businessOwnerEmail; + } + public void setBusinessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + } + + /** + **/ + public APISearchResultAllOfDTO technicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + return this; + } + + + @ApiModelProperty(example = "Technical Owner", value = "") + @JsonProperty("TechnicalOwner") + public String getTechnicalOwner() { + return technicalOwner; + } + public void setTechnicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + } + + /** + **/ + public APISearchResultAllOfDTO technicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "technicalowner@abc.com", value = "") + @JsonProperty("TechnicalOwnerEmail") + public String getTechnicalOwnerEmail() { + return technicalOwnerEmail; + } + public void setTechnicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + } + @Override public boolean equals(java.lang.Object o) { @@ -207,12 +297,17 @@ public boolean equals(java.lang.Object o) { Objects.equals(status, apISearchResultAllOf.status) && Objects.equals(thumbnailUri, apISearchResultAllOf.thumbnailUri) && Objects.equals(advertiseOnly, apISearchResultAllOf.advertiseOnly) && - Objects.equals(hasThumbnail, apISearchResultAllOf.hasThumbnail); + Objects.equals(hasThumbnail, apISearchResultAllOf.hasThumbnail) && + Objects.equals(monetizedInfo, apISearchResultAllOf.monetizedInfo) && + Objects.equals(businessOwner, apISearchResultAllOf.businessOwner) && + Objects.equals(businessOwnerEmail, apISearchResultAllOf.businessOwnerEmail) && + Objects.equals(technicalOwner, apISearchResultAllOf.technicalOwner) && + Objects.equals(technicalOwnerEmail, apISearchResultAllOf.technicalOwnerEmail); } @Override public int hashCode() { - return Objects.hash(description, context, contextTemplate, version, provider, status, thumbnailUri, advertiseOnly, hasThumbnail); + return Objects.hash(description, context, contextTemplate, version, provider, status, thumbnailUri, advertiseOnly, hasThumbnail, monetizedInfo, businessOwner, businessOwnerEmail, technicalOwner, technicalOwnerEmail); } @Override @@ -229,6 +324,11 @@ public String toString() { sb.append(" thumbnailUri: ").append(toIndentedString(thumbnailUri)).append("\n"); sb.append(" advertiseOnly: ").append(toIndentedString(advertiseOnly)).append("\n"); sb.append(" hasThumbnail: ").append(toIndentedString(hasThumbnail)).append("\n"); + sb.append(" monetizedInfo: ").append(toIndentedString(monetizedInfo)).append("\n"); + sb.append(" businessOwner: ").append(toIndentedString(businessOwner)).append("\n"); + sb.append(" businessOwnerEmail: ").append(toIndentedString(businessOwnerEmail)).append("\n"); + sb.append(" technicalOwner: ").append(toIndentedString(technicalOwner)).append("\n"); + sb.append(" technicalOwnerEmail: ").append(toIndentedString(technicalOwnerEmail)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APISearchResultDTO.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APISearchResultDTO.java index b959374e6c87..ff6eaffce2b1 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APISearchResultDTO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/gen/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/dto/APISearchResultDTO.java @@ -31,6 +31,11 @@ public class APISearchResultDTO extends SearchResultDTO { private String thumbnailUri = null; private Boolean advertiseOnly = null; private Boolean hasThumbnail = null; + private Boolean monetizedInfo = null; + private String businessOwner = null; + private String businessOwnerEmail = null; + private String technicalOwner = null; + private String technicalOwnerEmail = null; /** * A brief description about the API @@ -191,6 +196,91 @@ public void setHasThumbnail(Boolean hasThumbnail) { this.hasThumbnail = hasThumbnail; } + /** + **/ + public APISearchResultDTO monetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("monetizedInfo") + public Boolean isMonetizedInfo() { + return monetizedInfo; + } + public void setMonetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + } + + /** + **/ + public APISearchResultDTO businessOwner(String businessOwner) { + this.businessOwner = businessOwner; + return this; + } + + + @ApiModelProperty(example = "Business Owner", value = "") + @JsonProperty("businessOwner") + public String getBusinessOwner() { + return businessOwner; + } + public void setBusinessOwner(String businessOwner) { + this.businessOwner = businessOwner; + } + + /** + **/ + public APISearchResultDTO businessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "businessowner@abc.com", value = "") + @JsonProperty("businessOwnerEmail") + public String getBusinessOwnerEmail() { + return businessOwnerEmail; + } + public void setBusinessOwnerEmail(String businessOwnerEmail) { + this.businessOwnerEmail = businessOwnerEmail; + } + + /** + **/ + public APISearchResultDTO technicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + return this; + } + + + @ApiModelProperty(example = "Technical Owner", value = "") + @JsonProperty("TechnicalOwner") + public String getTechnicalOwner() { + return technicalOwner; + } + public void setTechnicalOwner(String technicalOwner) { + this.technicalOwner = technicalOwner; + } + + /** + **/ + public APISearchResultDTO technicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + return this; + } + + + @ApiModelProperty(example = "technicalowner@abc.com", value = "") + @JsonProperty("TechnicalOwnerEmail") + public String getTechnicalOwnerEmail() { + return technicalOwnerEmail; + } + public void setTechnicalOwnerEmail(String technicalOwnerEmail) { + this.technicalOwnerEmail = technicalOwnerEmail; + } + @Override public boolean equals(java.lang.Object o) { @@ -209,12 +299,17 @@ public boolean equals(java.lang.Object o) { Objects.equals(status, apISearchResult.status) && Objects.equals(thumbnailUri, apISearchResult.thumbnailUri) && Objects.equals(advertiseOnly, apISearchResult.advertiseOnly) && - Objects.equals(hasThumbnail, apISearchResult.hasThumbnail); + Objects.equals(hasThumbnail, apISearchResult.hasThumbnail) && + Objects.equals(monetizedInfo, apISearchResult.monetizedInfo) && + Objects.equals(businessOwner, apISearchResult.businessOwner) && + Objects.equals(businessOwnerEmail, apISearchResult.businessOwnerEmail) && + Objects.equals(technicalOwner, apISearchResult.technicalOwner) && + Objects.equals(technicalOwnerEmail, apISearchResult.technicalOwnerEmail); } @Override public int hashCode() { - return Objects.hash(description, context, contextTemplate, version, provider, status, thumbnailUri, advertiseOnly, hasThumbnail); + return Objects.hash(description, context, contextTemplate, version, provider, status, thumbnailUri, advertiseOnly, hasThumbnail, monetizedInfo, businessOwner, businessOwnerEmail, technicalOwner, technicalOwnerEmail); } @Override @@ -231,6 +326,11 @@ public String toString() { sb.append(" thumbnailUri: ").append(toIndentedString(thumbnailUri)).append("\n"); sb.append(" advertiseOnly: ").append(toIndentedString(advertiseOnly)).append("\n"); sb.append(" hasThumbnail: ").append(toIndentedString(hasThumbnail)).append("\n"); + sb.append(" monetizedInfo: ").append(toIndentedString(monetizedInfo)).append("\n"); + sb.append(" businessOwner: ").append(toIndentedString(businessOwner)).append("\n"); + sb.append(" businessOwnerEmail: ").append(toIndentedString(businessOwnerEmail)).append("\n"); + sb.append(" technicalOwner: ").append(toIndentedString(technicalOwner)).append("\n"); + sb.append(" technicalOwnerEmail: ").append(toIndentedString(technicalOwnerEmail)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/APIMappingUtil.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/APIMappingUtil.java index 8db46a61f44c..6b266d0ed093 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/APIMappingUtil.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/APIMappingUtil.java @@ -705,6 +705,11 @@ public static APIInfoDTO fromAPIToInfoDTO(API api) { apiInfoDTO.setAdditionalPropertiesMap(additionalPropertiesMap); apiInfoDTO.setGatewayVendor(api.getGatewayVendor()); } + apiInfoDTO.setMonetizedInfo(api.isMonetizationEnabled()); + apiInfoDTO.setBusinessOwner(api.getBusinessOwner()); + apiInfoDTO.setBusinessOwnerEmail(api.getBusinessOwnerEmail()); + apiInfoDTO.setTechnicalOwner(api.getTechnicalOwner()); + apiInfoDTO.setTechnicalOwnerEmail(api.getTechnicalOwnerEmail()); return apiInfoDTO; } @@ -2274,6 +2279,11 @@ public static APIProductListDTO fromAPIProductListtoDTO(List product if (apiProduct.getApiSecurity() != null) { productDto.setSecurityScheme(Arrays.asList(apiProduct.getApiSecurity().split(","))); } + productDto.setBusinessOwner(apiProduct.getBusinessOwner()); + productDto.setBusinessOwnerEmail(apiProduct.getBusinessOwnerEmail()); + productDto.setTechnicalOwner(apiProduct.getTechnicalOwner()); + productDto.setTechnicalOwnerEmail(apiProduct.getTechnicalOwnerEmail()); + productDto.setMonetizedInfo(apiProduct.isMonetizationEnabled()); list.add(productDto); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/SearchResultMappingUtil.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/SearchResultMappingUtil.java index 6a961cd253d0..67ef529209cf 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/SearchResultMappingUtil.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1.common/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/v1/common/mappings/SearchResultMappingUtil.java @@ -75,6 +75,11 @@ public static APISearchResultDTO fromAPIToAPIResultDTO(API api) { apiResultDTO.setThumbnailUri(api.getThumbnailUrl()); apiResultDTO.setAdvertiseOnly(api.isAdvertiseOnly()); apiResultDTO.setHasThumbnail(!StringUtils.isBlank(api.getThumbnailUrl())); + apiResultDTO.setBusinessOwner(api.getBusinessOwner()); + apiResultDTO.setBusinessOwnerEmail(api.getBusinessOwnerEmail()); + apiResultDTO.setTechnicalOwner(api.getTechnicalOwner()); + apiResultDTO.setTechnicalOwnerEmail(api.getTechnicalOwnerEmail()); + apiResultDTO.setMonetizedInfo(api.isMonetizationEnabled()); return apiResultDTO; } @@ -102,6 +107,11 @@ public static APIProductSearchResultDTO fromAPIProductToAPIResultDTO(APIProduct apiProductResultDTO.setStatus(apiProduct.getState()); apiProductResultDTO.setThumbnailUri(apiProduct.getThumbnailUrl()); apiProductResultDTO.setHasThumbnail(!StringUtils.isBlank(apiProduct.getThumbnailUrl())); + apiProductResultDTO.setBusinessOwner(apiProduct.getBusinessOwner()); + apiProductResultDTO.setBusinessOwnerEmail(apiProduct.getBusinessOwnerEmail()); + apiProductResultDTO.setTechnicalOwner(apiProduct.getTechnicalOwner()); + apiProductResultDTO.setTechnicalOwnerEmail(apiProduct.getTechnicalOwnerEmail()); + apiProductResultDTO.setMonetizedInfo(apiProduct.isMonetizationEnabled()); return apiProductResultDTO; } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/resources/publisher-api.yaml b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/resources/publisher-api.yaml index eba45bd78a92..87da4e93bcfe 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/resources/publisher-api.yaml +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher.v1/src/main/resources/publisher-api.yaml @@ -8493,6 +8493,21 @@ components: advertiseOnly: type: boolean example: true + monetizedInfo: + type: boolean + example: true + businessOwner: + type: string + example: Business Owner + businessOwnerEmail: + type: string + example: businessowner@abc.com + TechnicalOwner: + type: string + example: Technical Owner + TechnicalOwnerEmail: + type: string + example: technicalowner@abc.com APIMetadata: title: API Info object with basic minimal API details. type: object @@ -9242,6 +9257,21 @@ components: gatewayVendor: type: string example: wso2 + monetizedInfo: + type: boolean + example: true + businessOwner: + type: string + example: Business Owner + businessOwnerEmail: + type: string + example: businessowner@abc.com + TechnicalOwner: + type: string + example: Technical Owner + TechnicalOwnerEmail: + type: string + example: technicalowner@abc.com APIProduct: title: API Product object required: @@ -11221,6 +11251,21 @@ components: hasThumbnail: type: boolean example: true + monetizedInfo: + type: boolean + example: true + businessOwner: + type: string + example: Business Owner + businessOwnerEmail: + type: string + example: businessowner@abc.com + TechnicalOwner: + type: string + example: Technical Owner + TechnicalOwnerEmail: + type: string + example: technicalowner@abc.com APIProductSearchResult: title: API Result allOf: @@ -11255,6 +11300,21 @@ components: hasThumbnail: type: boolean example: true + monetizedInfo: + type: boolean + example: true + businessOwner: + type: string + example: Business Owner + businessOwnerEmail: + type: string + example: businessowner@abc.com + TechnicalOwner: + type: string + example: Technical Owner + TechnicalOwnerEmail: + type: string + example: technicalowner@abc.com APIMonetizationInfo: title: API monetization object required: diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APIInfoDTO.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APIInfoDTO.java index 081d5c5c3673..a549e2699aca 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APIInfoDTO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APIInfoDTO.java @@ -43,6 +43,7 @@ public class APIInfoDTO { private String monetizationLabel = null; private String gatewayVendor = null; private List additionalProperties = new ArrayList(); + private Boolean monetizedInfo = null; /** **/ @@ -357,6 +358,23 @@ public void setAdditionalProperties(List additio this.additionalProperties = additionalProperties; } + /** + **/ + public APIInfoDTO monetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("monetizedInfo") + public Boolean isMonetizedInfo() { + return monetizedInfo; + } + public void setMonetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + } + @Override public boolean equals(java.lang.Object o) { @@ -384,12 +402,13 @@ public boolean equals(java.lang.Object o) { Objects.equals(isSubscriptionAvailable, apIInfo.isSubscriptionAvailable) && Objects.equals(monetizationLabel, apIInfo.monetizationLabel) && Objects.equals(gatewayVendor, apIInfo.gatewayVendor) && - Objects.equals(additionalProperties, apIInfo.additionalProperties); + Objects.equals(additionalProperties, apIInfo.additionalProperties) && + Objects.equals(monetizedInfo, apIInfo.monetizedInfo); } @Override public int hashCode() { - return Objects.hash(id, name, description, context, version, type, createdTime, provider, lifeCycleStatus, thumbnailUri, avgRating, throttlingPolicies, advertiseInfo, businessInformation, isSubscriptionAvailable, monetizationLabel, gatewayVendor, additionalProperties); + return Objects.hash(id, name, description, context, version, type, createdTime, provider, lifeCycleStatus, thumbnailUri, avgRating, throttlingPolicies, advertiseInfo, businessInformation, isSubscriptionAvailable, monetizationLabel, gatewayVendor, additionalProperties, monetizedInfo); } @Override @@ -415,6 +434,7 @@ public String toString() { sb.append(" monetizationLabel: ").append(toIndentedString(monetizationLabel)).append("\n"); sb.append(" gatewayVendor: ").append(toIndentedString(gatewayVendor)).append("\n"); sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); + sb.append(" monetizedInfo: ").append(toIndentedString(monetizedInfo)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APISearchResultAllOfDTO.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APISearchResultAllOfDTO.java index 6cf42612baa1..5b19acd6d8fc 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APISearchResultAllOfDTO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APISearchResultAllOfDTO.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.wso2.carbon.apimgt.rest.api.store.v1.dto.APIBusinessInformationDTO; +import org.wso2.carbon.apimgt.rest.api.store.v1.dto.AdvertiseInfoDTO; import javax.validation.constraints.*; @@ -29,6 +30,8 @@ public class APISearchResultAllOfDTO { private String thumbnailUri = null; private APIBusinessInformationDTO businessInformation = null; private String avgRating = null; + private Boolean monetizedInfo = null; + private AdvertiseInfoDTO advertiseInfo = null; /** * A brief description about the API @@ -173,6 +176,41 @@ public void setAvgRating(String avgRating) { this.avgRating = avgRating; } + /** + **/ + public APISearchResultAllOfDTO monetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("monetizedInfo") + public Boolean isMonetizedInfo() { + return monetizedInfo; + } + public void setMonetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + } + + /** + **/ + public APISearchResultAllOfDTO advertiseInfo(AdvertiseInfoDTO advertiseInfo) { + this.advertiseInfo = advertiseInfo; + return this; + } + + + @ApiModelProperty(value = "") + @Valid + @JsonProperty("advertiseInfo") + public AdvertiseInfoDTO getAdvertiseInfo() { + return advertiseInfo; + } + public void setAdvertiseInfo(AdvertiseInfoDTO advertiseInfo) { + this.advertiseInfo = advertiseInfo; + } + @Override public boolean equals(java.lang.Object o) { @@ -190,12 +228,14 @@ public boolean equals(java.lang.Object o) { Objects.equals(status, apISearchResultAllOf.status) && Objects.equals(thumbnailUri, apISearchResultAllOf.thumbnailUri) && Objects.equals(businessInformation, apISearchResultAllOf.businessInformation) && - Objects.equals(avgRating, apISearchResultAllOf.avgRating); + Objects.equals(avgRating, apISearchResultAllOf.avgRating) && + Objects.equals(monetizedInfo, apISearchResultAllOf.monetizedInfo) && + Objects.equals(advertiseInfo, apISearchResultAllOf.advertiseInfo); } @Override public int hashCode() { - return Objects.hash(description, context, version, provider, status, thumbnailUri, businessInformation, avgRating); + return Objects.hash(description, context, version, provider, status, thumbnailUri, businessInformation, avgRating, monetizedInfo, advertiseInfo); } @Override @@ -211,6 +251,8 @@ public String toString() { sb.append(" thumbnailUri: ").append(toIndentedString(thumbnailUri)).append("\n"); sb.append(" businessInformation: ").append(toIndentedString(businessInformation)).append("\n"); sb.append(" avgRating: ").append(toIndentedString(avgRating)).append("\n"); + sb.append(" monetizedInfo: ").append(toIndentedString(monetizedInfo)).append("\n"); + sb.append(" advertiseInfo: ").append(toIndentedString(advertiseInfo)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APISearchResultDTO.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APISearchResultDTO.java index 55844c4c8242..ace4c40a69b9 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APISearchResultDTO.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/gen/java/org/wso2/carbon/apimgt/rest/api/store/v1/dto/APISearchResultDTO.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModelProperty; import org.wso2.carbon.apimgt.rest.api.store.v1.dto.APIBusinessInformationDTO; import org.wso2.carbon.apimgt.rest.api.store.v1.dto.APISearchResultAllOfDTO; +import org.wso2.carbon.apimgt.rest.api.store.v1.dto.AdvertiseInfoDTO; import org.wso2.carbon.apimgt.rest.api.store.v1.dto.SearchResultDTO; import javax.validation.constraints.*; @@ -31,6 +32,8 @@ public class APISearchResultDTO extends SearchResultDTO { private String thumbnailUri = null; private APIBusinessInformationDTO businessInformation = null; private String avgRating = null; + private Boolean monetizedInfo = null; + private AdvertiseInfoDTO advertiseInfo = null; /** * A brief description about the API @@ -175,6 +178,41 @@ public void setAvgRating(String avgRating) { this.avgRating = avgRating; } + /** + **/ + public APISearchResultDTO monetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + return this; + } + + + @ApiModelProperty(example = "true", value = "") + @JsonProperty("monetizedInfo") + public Boolean isMonetizedInfo() { + return monetizedInfo; + } + public void setMonetizedInfo(Boolean monetizedInfo) { + this.monetizedInfo = monetizedInfo; + } + + /** + **/ + public APISearchResultDTO advertiseInfo(AdvertiseInfoDTO advertiseInfo) { + this.advertiseInfo = advertiseInfo; + return this; + } + + + @ApiModelProperty(value = "") + @Valid + @JsonProperty("advertiseInfo") + public AdvertiseInfoDTO getAdvertiseInfo() { + return advertiseInfo; + } + public void setAdvertiseInfo(AdvertiseInfoDTO advertiseInfo) { + this.advertiseInfo = advertiseInfo; + } + @Override public boolean equals(java.lang.Object o) { @@ -192,12 +230,14 @@ public boolean equals(java.lang.Object o) { Objects.equals(status, apISearchResult.status) && Objects.equals(thumbnailUri, apISearchResult.thumbnailUri) && Objects.equals(businessInformation, apISearchResult.businessInformation) && - Objects.equals(avgRating, apISearchResult.avgRating); + Objects.equals(avgRating, apISearchResult.avgRating) && + Objects.equals(monetizedInfo, apISearchResult.monetizedInfo) && + Objects.equals(advertiseInfo, apISearchResult.advertiseInfo); } @Override public int hashCode() { - return Objects.hash(description, context, version, provider, status, thumbnailUri, businessInformation, avgRating); + return Objects.hash(description, context, version, provider, status, thumbnailUri, businessInformation, avgRating, monetizedInfo, advertiseInfo); } @Override @@ -213,6 +253,8 @@ public String toString() { sb.append(" thumbnailUri: ").append(toIndentedString(thumbnailUri)).append("\n"); sb.append(" businessInformation: ").append(toIndentedString(businessInformation)).append("\n"); sb.append(" avgRating: ").append(toIndentedString(avgRating)).append("\n"); + sb.append(" monetizedInfo: ").append(toIndentedString(monetizedInfo)).append("\n"); + sb.append(" advertiseInfo: ").append(toIndentedString(advertiseInfo)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1/mappings/APIMappingUtil.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1/mappings/APIMappingUtil.java index 17d314709c6e..fc8967c19c7b 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1/mappings/APIMappingUtil.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1/mappings/APIMappingUtil.java @@ -888,6 +888,7 @@ static APIInfoDTO fromAPIToInfoDTO(API api) throws APIManagementException { apiInfoDTO.setIsSubscriptionAvailable(isSubscriptionAvailable(apiTenant, subscriptionAvailability, subscriptionAllowedTenants)); apiInfoDTO.setGatewayVendor(api.getGatewayVendor()); + apiInfoDTO.setMonetizedInfo(api.isMonetizationEnabled()); return apiInfoDTO; } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1/mappings/SearchResultMappingUtil.java b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1/mappings/SearchResultMappingUtil.java index 1320dff4a9f3..2677ecef81e8 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1/mappings/SearchResultMappingUtil.java +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/java/org/wso2/carbon/apimgt/rest/api/store/v1/mappings/SearchResultMappingUtil.java @@ -31,6 +31,7 @@ import org.wso2.carbon.apimgt.rest.api.store.v1.dto.APISearchResultDTO; import org.wso2.carbon.apimgt.rest.api.store.v1.dto.SearchResultListDTO; import org.wso2.carbon.apimgt.rest.api.store.v1.dto.APIBusinessInformationDTO; +import org.wso2.carbon.apimgt.rest.api.store.v1.dto.AdvertiseInfoDTO; import org.wso2.carbon.apimgt.rest.api.common.RestApiConstants; import java.util.Map; @@ -78,6 +79,10 @@ public static APISearchResultDTO fromAPIToAPIResultDTO(API api) { apiResultDTO.setDescription(api.getDescription()); apiResultDTO.setStatus(api.getStatus()); apiResultDTO.setThumbnailUri(api.getThumbnailUrl()); + AdvertiseInfoDTO advertiseInfoDTO = new AdvertiseInfoDTO(); + advertiseInfoDTO.setAdvertised(api.isAdvertiseOnly()); + apiResultDTO.setAdvertiseInfo(advertiseInfoDTO); + apiResultDTO.setMonetizedInfo(api.isMonetizationEnabled()); return apiResultDTO; } diff --git a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/resources/devportal-api.yaml b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/resources/devportal-api.yaml index 2ced4a7c4808..5d022d963506 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/resources/devportal-api.yaml +++ b/components/apimgt/org.wso2.carbon.apimgt.rest.api.store.v1/src/main/resources/devportal-api.yaml @@ -3757,6 +3757,9 @@ components: description: | Custom(user defined) properties of API example: { } + monetizedInfo: + type: boolean + example: true APIInfoList: title: API Info List type: object @@ -5133,6 +5136,11 @@ components: type: string description: Average rating of the API example: "4.5" + monetizedInfo: + type: boolean + example: true + advertiseInfo: + $ref: '#/components/schemas/AdvertiseInfo' DocumentSearchResult: title: Document Result allOf: