package org.wfc.omada.api.account;

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 org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.wfc.omada.api.account.model.CreateUserVo;
import org.wfc.omada.api.account.model.DeleteUserVo;
import org.wfc.omada.api.account.model.ModifyControllerRoleVo;
import org.wfc.omada.api.account.model.ModifyUserVo;
import org.wfc.omada.api.account.model.OperationResponseControllerRoleDetailVo;
import org.wfc.omada.api.account.model.OperationResponseCreateRoleResultVo;
import org.wfc.omada.api.account.model.OperationResponseCreateUserResultVo;
import org.wfc.omada.api.account.model.OperationResponseGridVoUserDetailVo;
import org.wfc.omada.api.account.model.OperationResponseListControllerRoleDetailVo;
import org.wfc.omada.api.account.model.OperationResponseObject;
import org.wfc.omada.api.account.model.OperationResponseUserDetailVo;
import org.wfc.omada.api.account.model.OperationResponseWithoutResult;
import org.wfc.omada.config.FeignConfig;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T10:45:24.733+08:00[Asia/Shanghai]")

@Validated
@Api(value = "OmadaUserAndRole", description = "the OmadaUserAndRole API")
@FeignClient(name="OmadaUserAndRoleApi", url = "${omada.omada-url}", configuration = FeignConfig.class)
public interface OmadaUserAndRoleApi {

    /**
     * POST /openapi/v1/{omadacId}/roles : Create new role
     * Create new role. Only user with all permissions modify can use this interface.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Global Roles Manager Modify&lt;br/&gt;&lt;br/&gt;The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): &lt;br/&gt;-30156  -  This role already exists.&lt;br/&gt;-30158  -  An error occurred while creating the role.&lt;br/&gt;-30161  -  The number of roles has reached the limit.
     *
     * @param omadacId Omada ID (required)
     * @param modifyControllerRoleVo  (optional)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Create new role", nickname = "createNewRole", notes = "Create new role. Only user with all permissions modify can use this interface.<br/><br/>The interface requires one of the permissions: <br/>Global Roles Manager Modify<br/><br/>The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): <br/>-30156  -  This role already exists.<br/>-30158  -  An error occurred while creating the role.<br/>-30161  -  The number of roles has reached the limit.", response = OperationResponseCreateRoleResultVo.class, tags={ "Omada/User and Role","User and Role", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseCreateRoleResultVo.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/roles",
        produces = "*/*", 
        consumes = "application/json",
        method = RequestMethod.POST)
    ResponseEntity<OperationResponseCreateRoleResultVo> createNewRole(@ApiParam(value = ""  )  @Valid @RequestBody(required = false) ModifyControllerRoleVo modifyControllerRoleVo);


    /**
     * POST /openapi/v1/{omadacId}/users : Create new user
     * Create new user.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Global Users Manager Modify&lt;br/&gt;&lt;br/&gt;The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): &lt;br/&gt;-30103  -  Invalid email address.&lt;br/&gt;-30104  -  Invalid username.&lt;br/&gt;-30105  -  Invalid password.&lt;br/&gt;-30106  -  This username is already registered.&lt;br/&gt;-30124  -  The number of users has reached the limit.&lt;br/&gt;-44118  -  This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.
     *
     * @param omadacId Omada ID (required)
     * @param createUserVo  (optional)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Create new user", nickname = "createNewUser", notes = "Create new user.<br/><br/>The interface requires one of the permissions: <br/>Global Users Manager Modify<br/><br/>The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): <br/>-30103  -  Invalid email address.<br/>-30104  -  Invalid username.<br/>-30105  -  Invalid password.<br/>-30106  -  This username is already registered.<br/>-30124  -  The number of users has reached the limit.<br/>-44118  -  This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.", response = OperationResponseCreateUserResultVo.class, tags={ "Omada/User and Role","User and Role", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseCreateUserResultVo.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/users",
        produces = "*/*", 
        consumes = "application/json",
        method = RequestMethod.POST)
    ResponseEntity<OperationResponseCreateUserResultVo> createNewUser(@ApiParam(value = ""  )  @Valid @RequestBody(required = false) CreateUserVo createUserVo);


    /**
     * DELETE /openapi/v1/{omadacId}/roles/{roleId} : Delete an existing role
     * Delete an existing role. Only user with all permissions modify can use this interface&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Global Roles Manager Modify&lt;br/&gt;&lt;br/&gt;The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): &lt;br/&gt;-30102  -  This role does not exist.&lt;br/&gt;-30153  -  The default role cannot be deleted.&lt;br/&gt;-30154  -  An error occurred while deleting the role.&lt;br/&gt;-30155  -  The role cannot be deleted since someone has bound to it.&lt;br/&gt;-30173  -  The SSO bound role cannot be deleted!
     *
     * @param omadacId Omada ID (required)
     * @param roleId Role ID (required)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Delete an existing role", nickname = "deleteRole", notes = "Delete an existing role. Only user with all permissions modify can use this interface<br/><br/>The interface requires one of the permissions: <br/>Global Roles Manager Modify<br/><br/>The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): <br/>-30102  -  This role does not exist.<br/>-30153  -  The default role cannot be deleted.<br/>-30154  -  An error occurred while deleting the role.<br/>-30155  -  The role cannot be deleted since someone has bound to it.<br/>-30173  -  The SSO bound role cannot be deleted!", response = OperationResponseWithoutResult.class, tags={ "Omada/User and Role","User and Role", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseWithoutResult.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/roles/{roleId}",
        produces = "*/*", 
        method = RequestMethod.DELETE)
    ResponseEntity<OperationResponseWithoutResult> deleteRole(@ApiParam(value = "Role ID",required=true) @PathVariable("roleId") String roleId);


    /**
     * DELETE /openapi/v1/{omadacId}/users/{userID} : Delete an existing user
     * Delete an existing user. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Global Users Manager Modify&lt;br/&gt;&lt;br/&gt;The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): &lt;br/&gt;-30112  -  This user does not exist.&lt;br/&gt;-30114  -  An error occurred while deleting the user.&lt;br/&gt;-30132  -  Are you sure you want to delete Administrator %Username%? When it is deleted, the viewer accounts it has created will be moved to your account.&lt;br/&gt;-44118  -  This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.
     *
     * @param omadacId Omada ID (required)
     * @param userID  (required)
     * @param deleteUserVo  (optional)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Delete an existing user", nickname = "deleteUser", notes = "Delete an existing user. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.<br/><br/>The interface requires one of the permissions: <br/>Global Users Manager Modify<br/><br/>The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): <br/>-30112  -  This user does not exist.<br/>-30114  -  An error occurred while deleting the user.<br/>-30132  -  Are you sure you want to delete Administrator %Username%? When it is deleted, the viewer accounts it has created will be moved to your account.<br/>-44118  -  This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.", response = OperationResponseWithoutResult.class, tags={ "Omada/User and Role","User and Role", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseWithoutResult.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/users/{userID}",
        produces = "*/*", 
        consumes = "application/json",
        method = RequestMethod.DELETE)
    ResponseEntity<OperationResponseWithoutResult> deleteUser(@ApiParam(value = "",required=true) @PathVariable("userID") String userID,@ApiParam(value = ""  )  @Valid @RequestBody(required = false) DeleteUserVo deleteUserVo);


    /**
     * GET /openapi/v1/{omadacId}/roles : Get role list
     * Get role list&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Global Roles Manager View Only
     *
     * @param omadacId Omada ID (required)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Get role list", nickname = "getAllRoles", notes = "Get role list<br/><br/>The interface requires one of the permissions: <br/>Global Roles Manager View Only", response = OperationResponseListControllerRoleDetailVo.class, tags={ "Omada/User and Role","User and Role", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseListControllerRoleDetailVo.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/roles",
        produces = "*/*", 
        method = RequestMethod.GET)
    ResponseEntity<OperationResponseListControllerRoleDetailVo> getAllRoles(@ApiParam(value = "Omada ID",required=true) @PathVariable("omadacId") String omadacId);


    /**
     * GET /openapi/v1/{omadacId}/users : Get user list
     * Get user list. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Global Users Manager View Only&lt;br/&gt;&lt;br/&gt;The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): &lt;br/&gt;-44118  -  This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.
     *
     * @param omadacId  (required)
     * @param page Start page number. Start from 1. (required)
     * @param pageSize Number of entries per page. It should be within the range of 1–1000. (required)
     * @param sortsName Sort parameter may be one of asc or desc. Optional parameter. If it is not carried, it means it is not sorted by this field. When there are more than one, the first one takes effect (optional)
     * @param sortsRoleId Sort parameter may be one of asc or desc. Optional parameter. If it is not carried, it means it is not sorted by this field. When there are more than one, the first one takes effect (optional)
     * @param sortsEmail Sort parameter may be one of asc or desc. Optional parameter. If it is not carried, it means it is not sorted by this field. When there are more than one, the first one takes effect (optional)
     * @param searchKey Fuzzy query parameters, support field userName (optional)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Get user list", nickname = "getGridUsers", notes = "Get user list. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.<br/><br/>The interface requires one of the permissions: <br/>Global Users Manager View Only<br/><br/>The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): <br/>-44118  -  This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.", response = OperationResponseGridVoUserDetailVo.class, tags={ "Omada/User and Role","User and Role", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseGridVoUserDetailVo.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/users",
        produces = "*/*", 
        method = RequestMethod.GET)
    ResponseEntity<OperationResponseGridVoUserDetailVo> getGridUsers(@ApiParam(value = "",required=true) @PathVariable("omadacId") String omadacId,@NotNull @ApiParam(value = "Start page number. Start from 1.", required = true) @Valid @RequestParam(value = "page", required = true) Integer page,@NotNull @ApiParam(value = "Number of entries per page. It should be within the range of 1–1000.", required = true) @Valid @RequestParam(value = "pageSize", required = true) Integer pageSize,@ApiParam(value = "Sort parameter may be one of asc or desc. Optional parameter. If it is not carried, it means it is not sorted by this field. When there are more than one, the first one takes effect") @Valid @RequestParam(value = "sorts.name", required = false) String sortsName,@ApiParam(value = "Sort parameter may be one of asc or desc. Optional parameter. If it is not carried, it means it is not sorted by this field. When there are more than one, the first one takes effect") @Valid @RequestParam(value = "sorts.roleId", required = false) String sortsRoleId,@ApiParam(value = "Sort parameter may be one of asc or desc. Optional parameter. If it is not carried, it means it is not sorted by this field. When there are more than one, the first one takes effect") @Valid @RequestParam(value = "sorts.email", required = false) String sortsEmail,@ApiParam(value = "Fuzzy query parameters, support field userName") @Valid @RequestParam(value = "searchKey", required = false) String searchKey);


    /**
     * GET /openapi/v1/{omadacId}/roles/{roleId} : Get role info
     * Get role info&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Global Roles Manager View Only
     *
     * @param omadacId Omada ID (required)
     * @param roleId Role ID (required)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Get role info", nickname = "getRole", notes = "Get role info<br/><br/>The interface requires one of the permissions: <br/>Global Roles Manager View Only", response = OperationResponseControllerRoleDetailVo.class, tags={ "Omada/User and Role","User and Role", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseControllerRoleDetailVo.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/roles/{roleId}",
        produces = "*/*", 
        method = RequestMethod.GET)
    ResponseEntity<OperationResponseControllerRoleDetailVo> getRole(@ApiParam(value = "Role ID",required=true) @PathVariable("roleId") String roleId);


    /**
     * GET /openapi/v1/{omadacId}/users/{userID} : Get user info
     * Get user info. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Global Users Manager View Only&lt;br/&gt;&lt;br/&gt;The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): &lt;br/&gt;-44118  -  This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.
     *
     * @param omadacId Omada ID (required)
     * @param userID  (required)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Get user info", nickname = "getUser", notes = "Get user info. This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.<br/><br/>The interface requires one of the permissions: <br/>Global Users Manager View Only<br/><br/>The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): <br/>-44118  -  This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.", response = OperationResponseUserDetailVo.class, tags={ "Omada/User and Role","User and Role", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseUserDetailVo.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/users/{userID}",
        produces = "*/*", 
        method = RequestMethod.GET)
    ResponseEntity<OperationResponseUserDetailVo> getUser(@ApiParam(value = "",required=true) @PathVariable("userID") String userID);


    /**
     * PUT /openapi/v1/{omadacId}/roles/{roleId} : Modify an existing role
     * Modify an existing role. Only user with all permissions modify can use this interface.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Global Roles Manager Modify&lt;br/&gt;&lt;br/&gt;The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): &lt;br/&gt;-30102  -  This role does not exist.&lt;br/&gt;-30156  -  This role already exists.&lt;br/&gt;-30157  -  An error occurred while modifying the role.&lt;br/&gt;-30159  -  The default role cannot be modified.&lt;br/&gt;-30162  -  Cannot change the target account. Its role permission scope cannot be greater than its manager.
     *
     * @param omadacId Omada ID (required)
     * @param roleId Role ID (required)
     * @param modifyControllerRoleVo  (optional)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Modify an existing role", nickname = "modifyRole", notes = "Modify an existing role. Only user with all permissions modify can use this interface.<br/><br/>The interface requires one of the permissions: <br/>Global Roles Manager Modify<br/><br/>The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): <br/>-30102  -  This role does not exist.<br/>-30156  -  This role already exists.<br/>-30157  -  An error occurred while modifying the role.<br/>-30159  -  The default role cannot be modified.<br/>-30162  -  Cannot change the target account. Its role permission scope cannot be greater than its manager.", response = OperationResponseObject.class, tags={ "Omada/User and Role","User and Role", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseObject.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/roles/{roleId}",
        produces = "*/*", 
        consumes = "application/json",
        method = RequestMethod.PUT)
    ResponseEntity<OperationResponseObject> modifyRole(@ApiParam(value = "Role ID",required=true) @PathVariable("roleId") String roleId,@ApiParam(value = ""  )  @Valid @RequestBody(required = false) ModifyControllerRoleVo modifyControllerRoleVo);


    /**
     * PUT /openapi/v1/{omadacId}/users/{userID} : Modify an existing user
     * Modify an existing user.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Global Users Manager Modify&lt;br/&gt;&lt;br/&gt;The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): &lt;br/&gt;-30103  -  Invalid email address.&lt;br/&gt;-30104  -  Invalid username.&lt;br/&gt;-30105  -  Invalid password.&lt;br/&gt;-30106  -  This username is already registered.&lt;br/&gt;-30108  -  This username does not exist.&lt;br/&gt;-30133  -  Failed to remove Site %Site name%. The administrator account should not have privileges to fewer sites than that of the viewer accounts it has created.&lt;br/&gt;-30134  -  Failed to add Site %Site name%. The viewer account should not have privileges to more sites thatn that of its immediate superior account.&lt;br/&gt;-30135  -  Are you sure you want to change the role of %Username% from Administrator to Viewer?If its role is changed, the viewer accounts it has created will be moved to your account.&lt;br/&gt;-30136  -  Failed to save. If the editing is saved, the viewer account will have privileges to more sites than that of its immediate superior account.&lt;br/&gt;-44118  -  This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.
     *
     * @param omadacId Omada ID (required)
     * @param userID  (required)
     * @param modifyUserVo  (optional)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Modify an existing user", nickname = "modifyUser", notes = "Modify an existing user.<br/><br/>The interface requires one of the permissions: <br/>Global Users Manager Modify<br/><br/>The possible error code for the interface in the returned body is one of the following error codes (non generic error codes): <br/>-30103  -  Invalid email address.<br/>-30104  -  Invalid username.<br/>-30105  -  Invalid password.<br/>-30106  -  This username is already registered.<br/>-30108  -  This username does not exist.<br/>-30133  -  Failed to remove Site %Site name%. The administrator account should not have privileges to fewer sites than that of the viewer accounts it has created.<br/>-30134  -  Failed to add Site %Site name%. The viewer account should not have privileges to more sites thatn that of its immediate superior account.<br/>-30135  -  Are you sure you want to change the role of %Username% from Administrator to Viewer?If its role is changed, the viewer accounts it has created will be moved to your account.<br/>-30136  -  Failed to save. If the editing is saved, the viewer account will have privileges to more sites than that of its immediate superior account.<br/>-44118  -  This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.", response = OperationResponseObject.class, tags={ "Omada/User and Role","User and Role", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseObject.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/users/{userID}",
        produces = "*/*", 
        consumes = "application/json",
        method = RequestMethod.PUT)
    ResponseEntity<OperationResponseObject> modifyUser(@ApiParam(value = "",required=true) @PathVariable("userID") String userID,@ApiParam(value = ""  )  @Valid @RequestBody(required = false) ModifyUserVo modifyUserVo);

}
