package org.wfc.omada.api.msp;

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.msp.model.CustomerOpenApiVo;
import org.wfc.omada.api.msp.model.OperationResponseCreateCustomerOmadacVo;
import org.wfc.omada.api.msp.model.OperationResponseCustomerInfoOpenApiVo;
import org.wfc.omada.api.msp.model.OperationResponseGridVoCustomerInfoOpenApiVo;
import org.wfc.omada.api.msp.model.OperationResponseListCustomerInfoOpenApiVo;
import org.wfc.omada.api.msp.model.OperationResponseWithoutResult;

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

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

    /**
     * POST /openapi/v1/msp/{mspId}/customers : Create new customer
     * Create new customer(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;MSP Dashboard 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;-30145  -  The number of omadacs has reached the limit.&lt;br/&gt;-34706  -  This name already exists. Please enter another name for this customer.&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 mspId MSP ID (required)
     * @param customerOpenApiVo  (optional)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Create new customer", nickname = "createCustomer", notes = "Create new customer(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/>MSP Dashboard 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/>-30145  -  The number of omadacs has reached the limit.<br/>-34706  -  This name already exists. Please enter another name for this customer.<br/>-44118  -  This interface only supports the authorization code mode, not the client mode. Please call this interface in authorization code mode.", response = OperationResponseCreateCustomerOmadacVo.class, tags={ "Omada/Customer","Customer", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseCreateCustomerOmadacVo.class) })
    @RequestMapping(value = "/openapi/v1/msp/{mspId}/customers",
        produces = "*/*", 
        consumes = "application/json",
        method = RequestMethod.POST)
    ResponseEntity<OperationResponseCreateCustomerOmadacVo> createCustomer(@ApiParam(value = "MSP ID",required=true) @PathVariable("mspId") String mspId,@ApiParam(value = ""  )  @Valid @RequestBody(required = false) CustomerOpenApiVo customerOpenApiVo);


    /**
     * DELETE /openapi/v1/msp/{mspId}/customers/{customerId} : Delete an existing customer
     * Delete an existing customer(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;MSP Dashboard 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;-34707  -  Need to delete all sites of this customer before deleting this customer.&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 mspId MSP ID (required)
     * @param customerId Customer ID (required)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Delete an existing customer", nickname = "deleteCustomer", notes = "Delete an existing customer(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/>MSP Dashboard 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/>-34707  -  Need to delete all sites of this customer before deleting this customer.<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/Customer","Customer", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseWithoutResult.class) })
    @RequestMapping(value = "/openapi/v1/msp/{mspId}/customers/{customerId}",
        produces = "*/*", 
        method = RequestMethod.DELETE)
    ResponseEntity<OperationResponseWithoutResult> deleteCustomer(@ApiParam(value = "MSP ID",required=true) @PathVariable("mspId") String mspId,@ApiParam(value = "Customer ID",required=true) @PathVariable("customerId") String customerId);


    /**
     * GET /openapi/v1/msp/{mspId}/customers/{customerId} : Get customer info
     * Get customer info&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;MSP Dashboard View Only
     *
     * @param mspId MSP ID (required)
     * @param customerId Customer ID (required)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Get customer info", nickname = "getCustomerDetail", notes = "Get customer info<br/><br/>The interface requires one of the permissions: <br/>MSP Dashboard View Only", response = OperationResponseCustomerInfoOpenApiVo.class, tags={ "Omada/Customer","Customer", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseCustomerInfoOpenApiVo.class) })
    @RequestMapping(value = "/openapi/v1/msp/{mspId}/customers/{customerId}",
        produces = "*/*", 
        method = RequestMethod.GET)
    ResponseEntity<OperationResponseCustomerInfoOpenApiVo> getCustomerDetail(@ApiParam(value = "MSP ID",required=true) @PathVariable("mspId") String mspId,@ApiParam(value = "Customer ID",required=true) @PathVariable("customerId") String customerId);


    /**
     * GET /openapi/v1/msp/{mspId}/customers : Get customer list
     * Get customer list&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;MSP Dashboard View Only
     *
     * @param mspId MSP 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 name (optional)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Get customer list", nickname = "getCustomerList", notes = "Get customer list<br/><br/>The interface requires one of the permissions: <br/>MSP Dashboard View Only", response = OperationResponseGridVoCustomerInfoOpenApiVo.class, tags={ "Omada/Customer","Customer", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseGridVoCustomerInfoOpenApiVo.class) })
    @RequestMapping(value = "/openapi/v1/msp/{mspId}/customers",
        produces = "*/*", 
        method = RequestMethod.GET)
    ResponseEntity<OperationResponseGridVoCustomerInfoOpenApiVo> getCustomerList(@ApiParam(value = "MSP ID",required=true) @PathVariable("mspId") String mspId,@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 name") @Valid @RequestParam(value = "searchKey", required = false) String searchKey);


    /**
     * GET /openapi/v1/{omadacId}/copy/site/template/batch/customers : Obtain the customer ID with permission to modify site templates
     * Obtain the IDs of customers whose site templates the current user has permission to modify.&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;Global Site Template Manager Modify
     *
     * @param omadacId Omada ID (required)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Obtain the customer ID with permission to modify site templates", nickname = "getCustomersInGlobalHaveSiteTemplateModify", notes = "Obtain the IDs of customers whose site templates the current user has permission to modify.<br/><br/>The interface requires one of the permissions: <br/>Global Site Template Manager Modify", response = OperationResponseListCustomerInfoOpenApiVo.class, tags={ "Omada/Customer","Customer", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseListCustomerInfoOpenApiVo.class) })
    @RequestMapping(value = "/openapi/v1/${omada.omadac-id}/copy/site/template/batch/customers",
        produces = "*/*", 
        method = RequestMethod.GET)
    ResponseEntity<OperationResponseListCustomerInfoOpenApiVo> getCustomersInGlobalHaveSiteTemplateModify(@ApiParam(value = "Omada ID",required=true) @PathVariable("omadacId") String omadacId);


    /**
     * PATCH /openapi/v1/msp/{mspId}/customers/{customerId} : Modify an existing customer
     * Modify an existing customer&lt;br/&gt;&lt;br/&gt;The interface requires one of the permissions: &lt;br/&gt;MSP Dashboard 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;-34706  -  This name already exists. Please enter another name for this customer.
     *
     * @param mspId MSP ID (required)
     * @param customerId Customer ID (required)
     * @param customerOpenApiVo  (optional)
     * @return OK (status code 200)
     */
    @ApiOperation(value = "Modify an existing customer", nickname = "modifyCustomer", notes = "Modify an existing customer<br/><br/>The interface requires one of the permissions: <br/>MSP Dashboard 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/>-34706  -  This name already exists. Please enter another name for this customer.", response = OperationResponseWithoutResult.class, tags={ "Omada/Customer","Customer", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = OperationResponseWithoutResult.class) })
    @RequestMapping(value = "/openapi/v1/msp/{mspId}/customers/{customerId}",
        produces = "*/*", 
        consumes = "application/json",
        method = RequestMethod.PATCH)
    ResponseEntity<OperationResponseWithoutResult> modifyCustomer(@ApiParam(value = "MSP ID",required=true) @PathVariable("mspId") String mspId,@ApiParam(value = "Customer ID",required=true) @PathVariable("customerId") String customerId,@ApiParam(value = ""  )  @Valid @RequestBody(required = false) CustomerOpenApiVo customerOpenApiVo);

}
