package org.wfc.omada.api.hotspot;

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.config.FeignConfig;
import org.wfc.omada.api.hotspot.model.CreateLocalUserOpenApiVo;
import org.wfc.omada.api.hotspot.model.OperationResponseCreatedResIdOpenApiVo;
import org.wfc.omada.api.hotspot.model.OperationResponseGridVoLocalUserOpenApiVo;
import org.wfc.omada.api.hotspot.model.OperationResponseLocalUserOpenApiVo;
import org.wfc.omada.api.hotspot.model.OperationResponseWithoutResult;

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

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

    /**
     * POST /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers : Create a new local user
     * Create a local user with the given params.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Site Hotspot 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;-33000  -  This site does not exist.&lt;br/&gt;-33004  -  Operation failed because other operations are being performed on this site. Please wait and try again later.&lt;br/&gt;-42012  -  The number of local users has reached the limit. New local users cannot be created.&lt;br/&gt;-42013  -  Local user already exists.&lt;br/&gt;-42020  -  The MAC address that is bound to the local user account is invalid.&lt;br/&gt;-42037  -  Please select at least one portal before creating local users.&lt;br/&gt;-42039  -  Failed to bind to the portals. Please select the portals with local user authentication enabled.&lt;br/&gt;-44111  -  The Grant Type is Invalid.&lt;br/&gt;-44112  -  The access token has expired. Please re-initiate the refreshToken process to obtain the access token.
     *
     * @param omadacId Omada ID (required)
     * @param siteId Site ID (required)
     * @param createLocalUserOpenApiVo  (optional)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Create a new local user", nickname = "createLocalUser", notes = "Create a local user with the given params.<br/><br/>The interface requires one of the permissions: <br/>Site Hotspot 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/>-33000  -  This site does not exist.<br/>-33004  -  Operation failed because other operations are being performed on this site. Please wait and try again later.<br/>-42012  -  The number of local users has reached the limit. New local users cannot be created.<br/>-42013  -  Local user already exists.<br/>-42020  -  The MAC address that is bound to the local user account is invalid.<br/>-42037  -  Please select at least one portal before creating local users.<br/>-42039  -  Failed to bind to the portals. Please select the portals with local user authentication enabled.<br/>-44111  -  The Grant Type is Invalid.<br/>-44112  -  The access token has expired. Please re-initiate the refreshToken process to obtain the access token.", response = OperationResponseCreatedResIdOpenApiVo.class, tags={ "Omada/Local User","Local User", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseCreatedResIdOpenApiVo.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/sites/{siteId}/hotspot/localusers",
        produces = "*/*", 
        consumes = "application/json",
        method = RequestMethod.POST)
    ResponseEntity<OperationResponseCreatedResIdOpenApiVo> createLocalUser(@ApiParam(value = "Site ID",required=true) @PathVariable("siteId") String siteId,@ApiParam(value = ""  )  @Valid @RequestBody(required = false) CreateLocalUserOpenApiVo createLocalUserOpenApiVo);


    /**
     * DELETE /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/{id} : Delete an existing localuser
     * Delete an existing local user with the given omadacId, siteId, localuserId.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Site Hotspot 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;-33000  -  This site does not exist.&lt;br/&gt;-33004  -  Operation failed because other operations are being performed on this site. Please wait and try again later.&lt;br/&gt;-44111  -  The Grant Type is Invalid.&lt;br/&gt;-44112  -  The access token has expired. Please re-initiate the refreshToken process to obtain the access token.
     *
     * @param omadacId Omada ID (required)
     * @param siteId Site ID (required)
     * @param id Local user ID (required)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Delete an existing localuser", nickname = "deleteLocalUser", notes = "Delete an existing local user with the given omadacId, siteId, localuserId.<br/><br/>The interface requires one of the permissions: <br/>Site Hotspot 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/>-33000  -  This site does not exist.<br/>-33004  -  Operation failed because other operations are being performed on this site. Please wait and try again later.<br/>-44111  -  The Grant Type is Invalid.<br/>-44112  -  The access token has expired. Please re-initiate the refreshToken process to obtain the access token.", response = OperationResponseWithoutResult.class, tags={ "Omada/Local User","Local User", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseWithoutResult.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/sites/{siteId}/hotspot/localusers/{id}",
        produces = "*/*", 
        method = RequestMethod.DELETE)
    ResponseEntity<OperationResponseWithoutResult> deleteLocalUser(@ApiParam(value = "Site ID",required=true) @PathVariable("siteId") String siteId,@ApiParam(value = "Local user ID",required=true) @PathVariable("id") String id);


    /**
     * GET /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers/{id} : Get a local user for given localuserId
     * Get a local user with the given omadacId, siteId, local user ID.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Site Hotspot 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;-33000  -  This site does not exist.
     *
     * @param omadacId Omada ID (required)
     * @param siteId Site ID (required)
     * @param id local user ID (required)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Get a local user for given localuserId", nickname = "getLocalUser", notes = "Get a local user with the given omadacId, siteId, local user ID.<br/><br/>The interface requires one of the permissions: <br/>Site Hotspot 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/>-33000  -  This site does not exist.", response = OperationResponseLocalUserOpenApiVo.class, tags={ "Omada/Local User","Local User", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseLocalUserOpenApiVo.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/sites/{siteId}/hotspot/localusers/{id}",
        produces = "*/*", 
        method = RequestMethod.GET)
    ResponseEntity<OperationResponseLocalUserOpenApiVo> getLocalUser(@ApiParam(value = "Site ID",required=true) @PathVariable("siteId") String siteId,@ApiParam(value = "local user ID",required=true) @PathVariable("id") String id);


    /**
     * GET /openapi/v1/{omadacId}/sites/{siteId}/hotspot/localusers : Get local user list
     * Get local user list in a site with the given omadacId, siteId, params.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Site Hotspot 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;-33000  -  This site does not exist.
     *
     * @param omadacId Omada ID (required)
     * @param siteId Site ID (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 searchKey Fuzzy query parameters, support field user_name (optional)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Get local user list", nickname = "getLocalUsers", notes = "Get local user list in a site with the given omadacId, siteId, params.<br/><br/>The interface requires one of the permissions: <br/>Site Hotspot 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/>-33000  -  This site does not exist.", response = OperationResponseGridVoLocalUserOpenApiVo.class, tags={ "Omada/Local User","Local User", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseGridVoLocalUserOpenApiVo.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/sites/{siteId}/hotspot/localusers",
        produces = "*/*", 
        method = RequestMethod.GET)
    ResponseEntity<OperationResponseGridVoLocalUserOpenApiVo> getLocalUsers(@ApiParam(value = "Site ID",required=true) @PathVariable("siteId") String siteId,@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 = "Fuzzy query parameters, support field user_name") @Valid @RequestParam(value = "searchKey", required = false) String searchKey);

}
