diff --git a/components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/APIAdmin.java b/components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/APIAdmin.java index 8d06ba4e1ed2..687cbcbbafc8 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/APIAdmin.java +++ b/components/apimgt/org.wso2.carbon.apimgt.api/src/main/java/org/wso2/carbon/apimgt/api/APIAdmin.java @@ -20,10 +20,12 @@ import org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO; import org.wso2.carbon.apimgt.api.dto.KeyManagerPermissionConfigurationDTO; import org.wso2.carbon.apimgt.api.model.APICategory; +import org.wso2.carbon.apimgt.api.model.ApiResult; import org.wso2.carbon.apimgt.api.model.Application; import org.wso2.carbon.apimgt.api.model.ApplicationInfo; import org.wso2.carbon.apimgt.api.model.Environment; import org.wso2.carbon.apimgt.api.model.LLMProvider; +import org.wso2.carbon.apimgt.api.model.Label; import org.wso2.carbon.apimgt.api.model.Monetization; import org.wso2.carbon.apimgt.api.model.MonetizationUsagePublishInfo; import org.wso2.carbon.apimgt.api.model.Workflow; @@ -266,6 +268,75 @@ void updateMonetizationUsagePublishInfo(MonetizationUsagePublishInfo monetizatio */ APICategory getAPICategoryByID(String apiCategoryId) throws APIManagementException; + /** + * Adds a new label for the tenant + * + * @param label label to add + * @param tenantDomain tenant domain + * @throws APIManagementException if failed add label + */ + Label addLabel(Label label, String tenantDomain) throws APIManagementException; + + /** + * Updates a label + * + * @param label label to update + * @throws APIManagementException if failed update label + */ + void updateLabel(Label label) throws APIManagementException; + + /** + * Delete a label + * + * @param labelID label ID to delete + * @throws APIManagementException if failed delete label + */ + void deleteLabel(String labelID) throws APIManagementException; + + /** + * Checks whether a label exists by the given name + * + * 1. in case uuid is null : checks whether the labelName is already taken in the tenantDomain for the given type + * (this flow is used when adding a new label) + * 2. in case uuid is not null: checks whether the labelName is already taken by any label other than the one + * defined by the passed uuid in the given tenant and type + * + * @param labelName label name to check + * @param type label type + * @param uuid label UUID + * @param tenantDomain tenant domain + * @return true if a label exists by the given label name + * @throws APIManagementException if failed + */ + boolean isLabelNameExists(String labelName, String type, String uuid, String tenantDomain) throws APIManagementException; + + /** + * Returns all labels of the tenant + * + * @param tenantDomain tenant domain + * @return List