diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementConstants.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementConstants.java index 04600981fa..1c34f94170 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementConstants.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementConstants.java @@ -1,17 +1,19 @@ /* - * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * Copyright (c) 2020-2024, WSO2 LLC. (http://www.wso2.com). * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.identity.api.server.tenant.management.common; @@ -31,6 +33,7 @@ private TenantManagementConstants() { public static final String PAGINATION_WITH_FILTER_LINK_FORMAT = "?offset=%d&limit=%d&filter=%s"; public static final String PAGE_LINK_REL_NEXT = "next"; public static final String PAGE_LINK_REL_PREVIOUS = "previous"; + public static final String NON_EXISTING_USER_CODE = "30007 - "; /** * Enum for error messages. @@ -43,6 +46,12 @@ public enum ErrorMessage { ERROR_CODE_TENANT_LIMIT_REACHED("TM-60019", "Unable to create a tenant.", "Maximum number of allowed tenants have been reached."), + ERROR_CODE_OWNER_NOT_FOUND("TM-60020", + "Unable to retrieve the tenant owner.", + "Tenant owner cannot be found for the provided tenant id: %s."), + ERROR_CODE_PARTIALLY_CREATED_OR_UPDATED("TM-60021", + "Tenant creation / update was completed with errors.", + "Tenant creation / update was completed with error: %s"), ERROR_CODE_ERROR_LISTING_TENANTS("TM-65001", "Unable to list existing tenants.", "Server encountered an error while listing the tenants."), @@ -64,7 +73,11 @@ public enum ErrorMessage { "Unable to check availability of domain.", "Server encountered an error while checking for tenant domain"), ERROR_CODE_DELETE_TENANT_METADATA("TM-65008", "Error while deleting the tenant metadata.", - "Server encountered an error while deleting the tenant metadata identified by %s ."); + "Server encountered an error while deleting the tenant metadata identified by %s."), + ERROR_CODE_ERROR_RETRIEVING_OWNER("TM-65009", "Unable to retrieve the tenant owner.", + "Server encountered an error while retrieving the owner identified by tenant id %s."), + ERROR_CODE_ERROR_UPDATING_OWNER("TM-65010", "Unable to update the tenant owner.", + "Server encountered an error while updating the owner identified by tenant id %s."); private final String code; private final String message; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementServiceHolder.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementServiceHolder.java index b1d16bc533..336f822078 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementServiceHolder.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/TenantManagementServiceHolder.java @@ -1,21 +1,24 @@ /* - * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * Copyright (c) 2020-2024, WSO2 LLC. (http://www.wso2.com). * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. */ package org.wso2.carbon.identity.api.server.tenant.management.common; import org.wso2.carbon.tenant.mgt.services.TenantMgtService; +import org.wso2.carbon.user.core.service.RealmService; /** * Service holder class for tenant management. @@ -23,6 +26,7 @@ public class TenantManagementServiceHolder { private static TenantMgtService tenantMgtService; + private static RealmService realmService; /** * Get TenantMgtService osgi service. @@ -43,4 +47,24 @@ public static void setTenantMgtService(TenantMgtService tenantMgtService) { TenantManagementServiceHolder.tenantMgtService = tenantMgtService; } + + /** + * Get RealmService osgi service. + * + * @return RealmService + */ + public static RealmService getRealmService() { + + return realmService; + } + + /** + * Set RealmService osgi service. + * + * @param realmService RealmService. + */ + public static void setRealmService(RealmService realmService) { + + TenantManagementServiceHolder.realmService = realmService; + } } diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/factory/RealmServiceOSGIServiceFactory.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/factory/RealmServiceOSGIServiceFactory.java new file mode 100644 index 0000000000..e321492313 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.common/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/common/factory/RealmServiceOSGIServiceFactory.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.identity.api.server.tenant.management.common.factory; + +import org.springframework.beans.factory.config.AbstractFactoryBean; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.user.core.service.RealmService; + +/** + * Factory Beans serves as a factory for creating other beans within the IOC container. This factory bean is used to + * instantiate the RealmService inside the container. + */ +public class RealmServiceOSGIServiceFactory extends AbstractFactoryBean { + + private RealmService realmService; + + @Override + public Class getObjectType() { + + return Object.class; + } + + @Override + protected RealmService createInstance() throws Exception { + + if (this.realmService == null) { + RealmService realmService = (RealmService) + PrivilegedCarbonContext.getThreadLocalCarbonContext() + .getOSGiService(RealmService.class, null); + if (realmService != null) { + this.realmService = realmService; + } else { + throw new Exception("Unable to retrieve RealmService service."); + } + } + return this.realmService; + } +} diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApi.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApi.java index 4c0bdb7d78..b468d2adaa 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApi.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApi.java @@ -1,37 +1,39 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.Authorization; import org.springframework.beans.factory.annotation.Autowired; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import java.io.InputStream; -import java.util.List; - import org.wso2.carbon.identity.api.server.tenant.management.v1.model.ChannelVerifiedTenantModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.Error; -import org.wso2.carbon.identity.api.server.tenant.management.v1.ChannelVerifiedTenantsApiService; import javax.validation.Valid; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; import javax.ws.rs.core.Response; -import io.swagger.annotations.*; - -import javax.validation.constraints.*; @Path("/channel-verified-tenants") @Api(description = "The channel-verified-tenants API") diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApiService.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApiService.java index 215e059d07..55d26dd4fd 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApiService.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/ChannelVerifiedTenantsApiService.java @@ -1,29 +1,25 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1; -import org.wso2.carbon.identity.api.server.tenant.management.v1.*; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.*; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import java.io.InputStream; -import java.util.List; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.ChannelVerifiedTenantModel; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.Error; + import javax.ws.rs.core.Response; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java index 81405cdcbe..67411f774d 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApi.java @@ -1,41 +1,52 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.Authorization; import org.springframework.beans.factory.annotation.Autowired; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import java.io.InputStream; -import java.util.List; - import org.wso2.carbon.identity.api.server.tenant.management.v1.model.Error; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerInfoResponse; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerPutModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerResponse; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantPutModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantResponseModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantsListResponse; -import org.wso2.carbon.identity.api.server.tenant.management.v1.TenantsApiService; import javax.validation.Valid; -import javax.ws.rs.*; +import javax.validation.constraints.Min; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HEAD; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; -import io.swagger.annotations.*; - -import javax.validation.constraints.*; @Path("/tenants") @Api(description = "The tenants API") @@ -58,6 +69,7 @@ public class TenantsApi { }, tags={ "Tenants", }) @ApiResponses(value = { @ApiResponse(code = 201, message = "Item Created", response = Void.class), + @ApiResponse(code = 206, message = "Partial Content", response = Error.class), @ApiResponse(code = 400, message = "Invalid Input Request", response = Error.class), @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), @ApiResponse(code = 403, message = "Resource Forbidden", response = Void.class), @@ -93,6 +105,30 @@ public Response deleteTenantMetadata(@ApiParam(value = "tenant id",required=true return delegate.deleteTenantMetadata(tenantId ); } + @Valid + @GET + @Path("/{tenant-id}/owners/{owner-id}") + + @Produces({ "application/json" }) + @ApiOperation(value = "Retrieve tenant owner.", notes = "Retrieve the tenant owner identified by the provided tenant id and owner id. Permission required: * /permission/protected/manage/monitor/tenants/list scope required: * internal_list_tenants ", response = OwnerInfoResponse.class, authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "Tenants", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK", response = OwnerInfoResponse.class), + @ApiResponse(code = 400, message = "Invalid Input Request", response = Error.class), + @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + @ApiResponse(code = 403, message = "Resource Forbidden", response = Void.class), + @ApiResponse(code = 404, message = "The specified resource is not found", response = Error.class), + @ApiResponse(code = 500, message = "Internal Server Error", response = Error.class) + }) + public Response getOwner(@ApiParam(value = "tenant id",required=true) @PathParam("tenant-id") String tenantId, @ApiParam(value = "owner id",required=true) @PathParam("owner-id") String ownerId, @Valid@ApiParam(value = "Define set of additional user claims (as comma separated) to be returned.") @QueryParam("additionalClaims") String additionalClaims) { + + return delegate.getOwner(tenantId, ownerId, additionalClaims ); + } + @Valid @GET @Path("/{tenant-id}/owners") @@ -213,6 +249,31 @@ public Response retrieveTenants( @Valid @Min(0)@ApiParam(value = "Maximum num return delegate.retrieveTenants(limit, offset, sortOrder, sortBy, filter ); } + @Valid + @PUT + @Path("/{tenant-id}/owners/{owner-id}") + @Consumes({ "application/json" }) + @Produces({ "application/json" }) + @ApiOperation(value = "Update tenant owner.", notes = "This API provides the capability to update the tenant owner. Permission required: * /permission/protected/manage/modify/tenants scope required: * internal_modify_tenants ", response = Void.class, authorizations = { + @Authorization(value = "BasicAuth"), + @Authorization(value = "OAuth2", scopes = { + + }) + }, tags={ "Tenants", }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Successful", response = Void.class), + @ApiResponse(code = 206, message = "Partial Content", response = Error.class), + @ApiResponse(code = 400, message = "Invalid Input Request", response = Error.class), + @ApiResponse(code = 401, message = "Unauthorized", response = Void.class), + @ApiResponse(code = 403, message = "Resource Forbidden", response = Void.class), + @ApiResponse(code = 404, message = "The specified resource is not found", response = Error.class), + @ApiResponse(code = 500, message = "Internal Server Error", response = Error.class) + }) + public Response updateOwner(@ApiParam(value = "tenant id",required=true) @PathParam("tenant-id") String tenantId, @ApiParam(value = "owner id",required=true) @PathParam("owner-id") String ownerId, @ApiParam(value = "This represents the tenant owner to be updated." ,required=true) @Valid OwnerPutModel ownerPutModel) { + + return delegate.updateOwner(tenantId, ownerId, ownerPutModel ); + } + @Valid @PUT @Path("/{tenant-id}/lifecycle-status") diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApiService.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApiService.java index 0c5b5c1f2a..4941044b41 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApiService.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/TenantsApiService.java @@ -1,33 +1,27 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1; -import org.wso2.carbon.identity.api.server.tenant.management.v1.*; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.*; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import java.io.InputStream; -import java.util.List; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.Error; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerResponse; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerPutModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantPutModel; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantResponseModel; -import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantsListResponse; + import javax.ws.rs.core.Response; @@ -37,6 +31,8 @@ public interface TenantsApiService { public Response deleteTenantMetadata(String tenantId); + public Response getOwner(String tenantId, String ownerId, String additionalClaims); + public Response getOwners(String tenantId); public Response getTenant(String tenantId); @@ -47,5 +43,7 @@ public interface TenantsApiService { public Response retrieveTenants(Integer limit, Integer offset, String sortOrder, String sortBy, String filter); + public Response updateOwner(String tenantId, String ownerId, OwnerPutModel ownerPutModel); + public Response updateTenantStatus(String tenantId, TenantPutModel tenantPutModel); } diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/ChannelVerifiedTenantsApiServiceFactory.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/ChannelVerifiedTenantsApiServiceFactory.java index 044308568f..7dec970f02 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/ChannelVerifiedTenantsApiServiceFactory.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/ChannelVerifiedTenantsApiServiceFactory.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.factories; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/TenantsApiServiceFactory.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/TenantsApiServiceFactory.java index 1692d26b8d..1f8c29dcdf 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/TenantsApiServiceFactory.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/factories/TenantsApiServiceFactory.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.factories; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/AdditionalClaims.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/AdditionalClaims.java index c58a26ce84..5afbf60a7f 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/AdditionalClaims.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/AdditionalClaims.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Attribute.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Attribute.java index b51145e140..4662edc81f 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Attribute.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Attribute.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/ChannelVerifiedTenantModel.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/ChannelVerifiedTenantModel.java index a3a98a9f56..8587be875c 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/ChannelVerifiedTenantModel.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/ChannelVerifiedTenantModel.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Error.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Error.java index 334dd1028f..f60e4856af 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Error.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Error.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/LifeCycleStatus.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/LifeCycleStatus.java index 06e59417d9..fef139f9ba 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/LifeCycleStatus.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/LifeCycleStatus.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Link.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Link.java index e203e03917..eadcdc8155 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Link.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Link.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Owner.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Owner.java index 4fb88118fc..c02ad5467a 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Owner.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Owner.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerInfoResponse.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerInfoResponse.java new file mode 100644 index 0000000000..37e0f7a7f6 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerInfoResponse.java @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.identity.api.server.tenant.management.v1.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.AdditionalClaims; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; + +public class OwnerInfoResponse { + + private String id; + private String username; + private String email; + private String firstname; + private String lastname; + private List additionalClaims = null; + + + /** + * id of the tenant owner. + **/ + public OwnerInfoResponse id(String id) { + + this.id = id; + return this; + } + + @ApiModelProperty(example = "4875-jhgr-454hb", value = "id of the tenant owner.") + @JsonProperty("id") + @Valid + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + + /** + * Username for the tenant owner. + **/ + public OwnerInfoResponse username(String username) { + + this.username = username; + return this; + } + + @ApiModelProperty(example = "kim", value = "Username for the tenant owner.") + @JsonProperty("username") + @Valid + public String getUsername() { + return username; + } + public void setUsername(String username) { + this.username = username; + } + + /** + * Email address of the owner. + **/ + public OwnerInfoResponse email(String email) { + + this.email = email; + return this; + } + + @ApiModelProperty(example = "kim@wso2.com", value = "Email address of the owner.") + @JsonProperty("email") + @Valid + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + * First name of the owner. + **/ + public OwnerInfoResponse firstname(String firstname) { + + this.firstname = firstname; + return this; + } + + @ApiModelProperty(example = "kim", value = "First name of the owner.") + @JsonProperty("firstname") + @Valid + public String getFirstname() { + return firstname; + } + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + /** + * Last name of the owner. + **/ + public OwnerInfoResponse lastname(String lastname) { + + this.lastname = lastname; + return this; + } + + @ApiModelProperty(example = "kim", value = "Last name of the owner.") + @JsonProperty("lastname") + @Valid + public String getLastname() { + return lastname; + } + public void setLastname(String lastname) { + this.lastname = lastname; + } + + /** + **/ + public OwnerInfoResponse additionalClaims(List additionalClaims) { + + this.additionalClaims = additionalClaims; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("additionalClaims") + @Valid + public List getAdditionalClaims() { + return additionalClaims; + } + public void setAdditionalClaims(List additionalClaims) { + this.additionalClaims = additionalClaims; + } + + public OwnerInfoResponse addAdditionalClaimsItem(AdditionalClaims additionalClaimsItem) { + if (this.additionalClaims == null) { + this.additionalClaims = new ArrayList<>(); + } + this.additionalClaims.add(additionalClaimsItem); + return this; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OwnerInfoResponse ownerInfoResponse = (OwnerInfoResponse) o; + return Objects.equals(this.id, ownerInfoResponse.id) && + Objects.equals(this.username, ownerInfoResponse.username) && + Objects.equals(this.email, ownerInfoResponse.email) && + Objects.equals(this.firstname, ownerInfoResponse.firstname) && + Objects.equals(this.lastname, ownerInfoResponse.lastname) && + Objects.equals(this.additionalClaims, ownerInfoResponse.additionalClaims); + } + + @Override + public int hashCode() { + return Objects.hash(id, username, email, firstname, lastname, additionalClaims); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class OwnerInfoResponse {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstname: ").append(toIndentedString(firstname)).append("\n"); + sb.append(" lastname: ").append(toIndentedString(lastname)).append("\n"); + sb.append(" additionalClaims: ").append(toIndentedString(additionalClaims)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n"); + } +} + diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerPutModel.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerPutModel.java new file mode 100644 index 0000000000..6b51180b47 --- /dev/null +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerPutModel.java @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.wso2.carbon.identity.api.server.tenant.management.v1.model; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.AdditionalClaims; +import javax.validation.constraints.*; + + +import io.swagger.annotations.*; +import java.util.Objects; +import javax.validation.Valid; +import javax.xml.bind.annotation.*; + +public class OwnerPutModel { + + private String email; + private String password; + private String firstname; + private String lastname; + private List additionalClaims = null; + + + /** + * Email address of the owner. + **/ + public OwnerPutModel email(String email) { + + this.email = email; + return this; + } + + @ApiModelProperty(example = "kim@wso2.com", required = true, value = "Email address of the owner.") + @JsonProperty("email") + @Valid + @NotNull(message = "Property email cannot be null.") + + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + /** + * Password of the owner. + **/ + public OwnerPutModel password(String password) { + + this.password = password; + return this; + } + + @ApiModelProperty(example = "kim123", value = "Password of the owner.") + @JsonProperty("password") + @Valid + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + /** + * First name of the owner. + **/ + public OwnerPutModel firstname(String firstname) { + + this.firstname = firstname; + return this; + } + + @ApiModelProperty(example = "kim", required = true, value = "First name of the owner.") + @JsonProperty("firstname") + @Valid + @NotNull(message = "Property firstname cannot be null.") + + public String getFirstname() { + return firstname; + } + public void setFirstname(String firstname) { + this.firstname = firstname; + } + + /** + * Last name of the owner. + **/ + public OwnerPutModel lastname(String lastname) { + + this.lastname = lastname; + return this; + } + + @ApiModelProperty(example = "kim", required = true, value = "Last name of the owner.") + @JsonProperty("lastname") + @Valid + @NotNull(message = "Property lastname cannot be null.") + + public String getLastname() { + return lastname; + } + public void setLastname(String lastname) { + this.lastname = lastname; + } + + /** + **/ + public OwnerPutModel additionalClaims(List additionalClaims) { + + this.additionalClaims = additionalClaims; + return this; + } + + @ApiModelProperty(value = "") + @JsonProperty("additionalClaims") + @Valid + public List getAdditionalClaims() { + return additionalClaims; + } + public void setAdditionalClaims(List additionalClaims) { + this.additionalClaims = additionalClaims; + } + + public OwnerPutModel addAdditionalClaimsItem(AdditionalClaims additionalClaimsItem) { + if (this.additionalClaims == null) { + this.additionalClaims = new ArrayList<>(); + } + this.additionalClaims.add(additionalClaimsItem); + return this; + } + + + + @Override + public boolean equals(java.lang.Object o) { + + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OwnerPutModel ownerPutModel = (OwnerPutModel) o; + return Objects.equals(this.email, ownerPutModel.email) && + Objects.equals(this.password, ownerPutModel.password) && + Objects.equals(this.firstname, ownerPutModel.firstname) && + Objects.equals(this.lastname, ownerPutModel.lastname) && + Objects.equals(this.additionalClaims, ownerPutModel.additionalClaims); + } + + @Override + public int hashCode() { + return Objects.hash(email, password, firstname, lastname, additionalClaims); + } + + @Override + public String toString() { + + StringBuilder sb = new StringBuilder(); + sb.append("class OwnerPutModel {\n"); + + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" firstname: ").append(toIndentedString(firstname)).append("\n"); + sb.append(" lastname: ").append(toIndentedString(lastname)).append("\n"); + sb.append(" additionalClaims: ").append(toIndentedString(additionalClaims)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n"); + } +} + diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerResponse.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerResponse.java index 5a203994c4..a2b7b56ab1 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerResponse.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/OwnerResponse.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Purpose.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Purpose.java index 372b8d46f1..53e7bce44f 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Purpose.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/Purpose.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantListItem.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantListItem.java index 081d46601f..f74e70a312 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantListItem.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantListItem.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantModel.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantModel.java index 8ac2fca41c..1f1aa14b69 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantModel.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantModel.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantPutModel.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantPutModel.java index 085d3c6261..feb9f6a214 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantPutModel.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantPutModel.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantResponseModel.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantResponseModel.java index 32d07387da..5757542d85 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantResponseModel.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantResponseModel.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantsListResponse.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantsListResponse.java index 574a1a3f20..d0cc220671 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantsListResponse.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/gen/java/org/wso2/carbon/identity/api/server/tenant/management/v1/model/TenantsListResponse.java @@ -1,18 +1,20 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.wso2.carbon.identity.api.server.tenant.management.v1.model; diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java index 330dc1112e..23f98cdeb6 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/core/ServerTenantManagementService.java @@ -28,6 +28,8 @@ import org.wso2.carbon.identity.api.server.tenant.management.v1.model.ChannelVerifiedTenantModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.LifeCycleStatus; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.Link; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerInfoResponse; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerPutModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerResponse; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantListItem; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantModel; @@ -42,8 +44,11 @@ import org.wso2.carbon.stratos.common.exception.TenantManagementClientException; import org.wso2.carbon.stratos.common.exception.TenantManagementServerException; import org.wso2.carbon.stratos.common.exception.TenantMgtException; +import org.wso2.carbon.stratos.common.util.ClaimsMgtUtil; import org.wso2.carbon.tenant.mgt.services.TenantMgtService; +import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.common.User; +import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.user.core.tenant.Tenant; import org.wso2.carbon.user.core.tenant.TenantSearchResult; @@ -62,6 +67,7 @@ import static org.wso2.carbon.identity.api.server.common.Constants.ERROR_CODE_RESOURCE_LIMIT_REACHED; import static org.wso2.carbon.identity.api.server.common.Constants.V1_API_PATH_COMPONENT; +import static org.wso2.carbon.identity.api.server.tenant.management.common.TenantManagementConstants.ErrorMessage.ERROR_CODE_PARTIALLY_CREATED_OR_UPDATED; import static org.wso2.carbon.identity.api.server.tenant.management.common.TenantManagementConstants.ErrorMessage.ERROR_CODE_TENANT_LIMIT_REACHED; import static org.wso2.carbon.identity.api.server.tenant.management.common.TenantManagementConstants.TENANT_MANAGEMENT_PATH_COMPONENT; import static org.wso2.carbon.stratos.common.constants.TenantConstants.ErrorMessage.ERROR_CODE_INVALID_EMAIL; @@ -193,6 +199,35 @@ public List getOwners(String tenantUniqueID) { } } + public OwnerInfoResponse getOwner(String tenantUniqueID, String ownerID, String additionalClaims) { + + try { + Tenant tenant = TenantManagementServiceHolder.getTenantMgtService().getTenant(tenantUniqueID); + validateTenantOwnerId(tenant, ownerID); + + String[] claimsList = StringUtils.split(additionalClaims, ","); + return createOwnerInfoResponse(tenant, claimsList); + } catch (TenantMgtException e) { + throw handleTenantManagementException(e, TenantManagementConstants.ErrorMessage. + ERROR_CODE_ERROR_RETRIEVING_OWNER, tenantUniqueID); + } + } + + public void updateOwner(String tenantUniqueID, String ownerID, OwnerPutModel ownerPutModel) { + + try { + Tenant tenant = TenantManagementServiceHolder.getTenantMgtService().getTenant(tenantUniqueID); + validateTenantOwnerId(tenant, ownerID); + + createTenantInfoBean(tenant, ownerPutModel); + + TenantManagementServiceHolder.getTenantMgtService().updateOwner(tenant); + } catch (TenantMgtException e) { + throw handleTenantManagementException(e, TenantManagementConstants.ErrorMessage. + ERROR_CODE_ERROR_UPDATING_OWNER, tenantUniqueID); + } + } + /** * Delete the metadata of the tenant which is identified by tenant unique id. * @@ -241,6 +276,74 @@ private List createOwnerResponse(User user) { return ownerResponseList; } + private void createTenantInfoBean(Tenant tenant, OwnerPutModel ownerPutModel) { + + if (StringUtils.isNotBlank(ownerPutModel.getFirstname())) { + tenant.setAdminFirstName(ownerPutModel.getFirstname()); + } + if (StringUtils.isNotBlank(ownerPutModel.getLastname())) { + tenant.setAdminLastName(ownerPutModel.getLastname()); + } + if (StringUtils.isNotBlank(ownerPutModel.getEmail())) { + tenant.setEmail(ownerPutModel.getEmail()); + } + tenant.setAdminPassword(ownerPutModel.getPassword()); + List additionalClaimsList = ownerPutModel.getAdditionalClaims(); + if (CollectionUtils.isNotEmpty(additionalClaimsList)) { + tenant.setClaimsMap(createClaimsMapping(additionalClaimsList)); + } else { + // Avoid updating the claims map if the request does not contain any additional claims. + tenant.setClaimsMap(new HashMap<>()); + } + } + + private void validateTenantOwnerId(Tenant tenant, String ownerID) { + + if (tenant.getAdminUserId() == null || !tenant.getAdminUserId().equals(ownerID)) { + throw handleException(Response.Status.BAD_REQUEST, TenantManagementConstants.ErrorMessage. + ERROR_CODE_OWNER_NOT_FOUND, tenant.getTenantUniqueID()); + } + } + + private OwnerInfoResponse createOwnerInfoResponse(Tenant tenant, String[] claimsList) throws TenantMgtException { + + RealmService realmService = TenantManagementServiceHolder.getRealmService(); + OwnerInfoResponse ownerInfoResponse = new OwnerInfoResponse(); + ownerInfoResponse.setId(tenant.getAdminUserId()); + ownerInfoResponse.setUsername(tenant.getAdminName()); + ownerInfoResponse.setEmail(tenant.getEmail()); + + try { + ownerInfoResponse.setFirstname(ClaimsMgtUtil.getFirstNamefromUserStoreManager( + realmService, tenant.getId())); + ownerInfoResponse.setLastname(ClaimsMgtUtil.getLastNamefromUserStoreManager( + realmService, tenant.getId())); + } catch (UserStoreException e) { + if (e.getMessage().startsWith(TenantManagementConstants.NON_EXISTING_USER_CODE)) { + throw handleException(Response.Status.NOT_FOUND, TenantManagementConstants.ErrorMessage. + ERROR_CODE_OWNER_NOT_FOUND, tenant.getTenantUniqueID()); + } + throw new TenantMgtException(e.getMessage()); + } + + if (claimsList != null) { + for (String claim : claimsList) { + try { + String claimValue = ClaimsMgtUtil.getClaimfromUserStoreManager(realmService, tenant.getId(), claim); + if (StringUtils.isNotBlank(claimValue)) { + ownerInfoResponse.addAdditionalClaimsItem( + new AdditionalClaims().claim(claim).value(claimValue)); + } + } catch (org.wso2.carbon.user.core.UserStoreException e) { + if (log.isDebugEnabled()) { + log.debug("Error while retrieving claim: " + claim + " for tenant: " + tenant.getId(), e); + } + } + } + } + return ownerInfoResponse; + } + private TenantResponseModel createTenantResponse(Tenant tenant) { TenantResponseModel tenantResponseModel = new TenantResponseModel(); @@ -430,6 +533,9 @@ private APIError handleTenantManagementException(TenantMgtException e, if (ERROR_CODE_RESOURCE_LIMIT_REACHED.equals(e.getErrorCode())) { return handleResourceLimitReached(); } + if (ERROR_CODE_PARTIALLY_CREATED_OR_UPDATED.getCode().equals(e.getErrorCode())) { + return handleResourcePartiallyCreated(e); + } errorResponse = getErrorBuilder(errorEnum, data).build(log, e.getMessage()); if (e.getErrorCode() != null) { String errorCode = e.getErrorCode(); @@ -461,6 +567,14 @@ private APIError handleResourceLimitReached() { return new APIError(status, errorResponse); } + private APIError handleResourcePartiallyCreated(TenantMgtException e) { + + String errorMessage = e.getCause().getMessage(); + ErrorResponse errorResponse = getErrorBuilder(ERROR_CODE_PARTIALLY_CREATED_OR_UPDATED, errorMessage) + .build(log, errorMessage); + return new APIError(Response.Status.PARTIAL_CONTENT, errorResponse); + } + /** * Return error builder. * diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/impl/TenantsApiServiceImpl.java b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/impl/TenantsApiServiceImpl.java index 5175cf8290..542bd0140f 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/impl/TenantsApiServiceImpl.java +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/java/org/wso2/carbon/identity/api/server/tenant/management/v1/impl/TenantsApiServiceImpl.java @@ -1,18 +1,21 @@ /* -* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (c) 2020-2024, WSO2 LLC. (http://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.wso2.carbon.identity.api.server.tenant.management.v1.impl; import org.springframework.beans.factory.annotation.Autowired; @@ -21,6 +24,7 @@ import org.wso2.carbon.identity.api.server.tenant.management.common.TenantManagementConstants; import org.wso2.carbon.identity.api.server.tenant.management.v1.TenantsApiService; import org.wso2.carbon.identity.api.server.tenant.management.v1.core.ServerTenantManagementService; +import org.wso2.carbon.identity.api.server.tenant.management.v1.model.OwnerPutModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantModel; import org.wso2.carbon.identity.api.server.tenant.management.v1.model.TenantPutModel; @@ -50,6 +54,12 @@ public Response deleteTenantMetadata(String tenantId) { return Response.noContent().build(); } + @Override + public Response getOwner(String tenantId, String ownerId, String additionalClaims) { + + return Response.ok().entity(tenantManagementService.getOwner(tenantId, ownerId, additionalClaims)).build(); + } + @Override public Response getOwners(String tenantUniqueIdentifier) { @@ -69,6 +79,13 @@ public Response retrieveTenants(Integer limit, Integer offset, String sortOrder, build(); } + @Override + public Response updateOwner(String tenantId, String ownerId, OwnerPutModel ownerPutModel) { + + tenantManagementService.updateOwner(tenantId, ownerId, ownerPutModel); + return Response.ok().build(); + } + @Override public Response updateTenantStatus(String tenantId, TenantPutModel tenantPutModel) { diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/META-INF/cxf/tenant-management-server-v1-cxf.xml b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/META-INF/cxf/tenant-management-server-v1-cxf.xml index 9c5677860a..23eabc8c31 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/META-INF/cxf/tenant-management-server-v1-cxf.xml +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/META-INF/cxf/tenant-management-server-v1-cxf.xml @@ -25,6 +25,13 @@ class="org.wso2.carbon.identity.api.server.tenant.management.common.TenantManagementServiceHolder"> + + + + + diff --git a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml index 5419baf114..42e23745c8 100644 --- a/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml +++ b/components/org.wso2.carbon.identity.api.server.tenant.management/org.wso2.carbon.identity.api.server.tenant.management.v1/src/main/resources/tenant-management.yaml @@ -85,6 +85,8 @@ paths: description: Location of the newly created tenant schema: type: string + '206': + $ref: '#/components/responses/PartialContent' '400': $ref: '#/components/responses/InvalidInput' '401': @@ -311,6 +313,79 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + '/tenants/{tenant-id}/owners/{owner-id}': + get: + tags: + - Tenants + summary: Retrieve tenant owner. + operationId: getOwner + description: | + Retrieve the tenant owner identified by the provided tenant id and owner id. + + Permission required: + * /permission/protected/manage/monitor/tenants/list + + scope required: + * internal_list_tenants + parameters: + - $ref: '#/components/parameters/tenantIdPathParam' + - $ref: '#/components/parameters/ownerIdPathParam' + - $ref: '#/components/parameters/additionalClaimsQueryParam' + responses: + '200': + description: OK + content: + 'application/json': + schema: + $ref: '#/components/schemas/OwnerInfoResponse' + '400': + $ref: '#/components/responses/InvalidInput' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/ServerError' + put: + tags: + - Tenants + summary: Update tenant owner. + operationId: updateOwner + description: | + This API provides the capability to update the tenant owner. + + Permission required: + * /permission/protected/manage/modify/tenants + + scope required: + * internal_modify_tenants + parameters: + - $ref: '#/components/parameters/tenantIdPathParam' + - $ref: '#/components/parameters/ownerIdPathParam' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OwnerPutModel' + description: This represents the tenant owner to be updated. + required: true + responses: + '200': + $ref: '#/components/responses/Updated' + '206': + $ref: '#/components/responses/PartialContent' + '400': + $ref: '#/components/responses/InvalidInput' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '404': + $ref: '#/components/responses/NotFound' + '500': + $ref: '#/components/responses/ServerError' '/tenants/{tenant-id}/metadata': delete: tags: @@ -365,6 +440,13 @@ components: description: tenant id schema: type: string + ownerIdPathParam: + in: path + name: owner-id + required: true + description: owner id + schema: + type: string tenantDomainPathParam: in: path name: tenant-domain @@ -421,6 +503,15 @@ components: option is not yet supported._ schema: type: string + additionalClaimsQueryParam: + in: query + name: additionalClaims + required: false + description: >- + Define set of additional user claims (as comma separated) to be returned. + schema: + type: string + example: http://wso2.org/claims/telephone responses: NotFound: description: The specified resource is not found @@ -440,6 +531,12 @@ components: 'application/json': schema: $ref: '#/components/schemas/Error' + PartialContent: + description: Partial Content + content: + 'application/json': + schema: + $ref: '#/components/schemas/Error' InvalidInput: description: Invalid Input Request content: @@ -638,6 +735,62 @@ components: items: $ref: '#/components/schemas/AdditionalClaims' + OwnerPutModel: + type: object + required: + - email + - firstname + - lastname + properties: + email: + type: string + example: kim@wso2.com + description: Email address of the owner. + password: + type: string + example: kim123 + description: Password of the owner. + firstname: + type: string + example: kim + description: First name of the owner. + lastname: + type: string + example: kim + description: Last name of the owner. + additionalClaims: + type: array + items: + $ref: '#/components/schemas/AdditionalClaims' + + OwnerInfoResponse: + type: object + properties: + id: + type: string + example: "4875-jhgr-454hb" + description: id of the tenant owner. + username: + type: string + example: kim + description: Username for the tenant owner. + email: + type: string + example: kim@wso2.com + description: Email address of the owner. + firstname: + type: string + example: kim + description: First name of the owner. + lastname: + type: string + example: kim + description: Last name of the owner. + additionalClaims: + type: array + items: + $ref: '#/components/schemas/AdditionalClaims' + OwnerResponse: type: object properties: diff --git a/pom.xml b/pom.xml index 1a5ba1f61a..87980276fe 100644 --- a/pom.xml +++ b/pom.xml @@ -813,7 +813,7 @@ 1.9.4 findbugs-exclude-filter.xml 4.9.17 - 4.9.10 + 4.11.27 0.7.12 2.5.15 4.10.11