/**
 * NOTE: This class is auto generated by the swagger code generator program (3.0.18).
 * https://github.com/swagger-api/swagger-codegen
 * Do not edit the class manually.
 */
package io.swagger.api.core;

import io.swagger.model.BrAPIResponse;
import io.swagger.model.Model202AcceptedSearchResponse;
import io.swagger.model.core.StudyListResponse;
import io.swagger.model.core.StudyNewRequest;
import io.swagger.model.core.StudySearchRequest;
import io.swagger.model.core.StudySingleResponse;
import io.swagger.annotations.*;

import org.brapi.test.BrAPITestServer.exceptions.BrAPIServerException;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import jakarta.validation.Valid;
import java.util.List;

@javax.annotation.processing.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-03-20T16:31:52.030Z[GMT]")
@Api(value = "studies", description = "the studies API")
public interface StudiesApi {

	@ApiOperation(value = "Get a filtered list of Studies", nickname = "studiesGet", notes = "Get list of studies  StartDate and endDate should be ISO-8601 format for dates", response = StudyListResponse.class, authorizations = {
			@Authorization(value = "AuthorizationToken") }, tags = { "Studies", })
	@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = StudyListResponse.class),
			@ApiResponse(code = 400, message = "Bad Request", response = String.class),
			@ApiResponse(code = 401, message = "Unauthorized", response = String.class),
			@ApiResponse(code = 403, message = "Forbidden", response = String.class) })
	@RequestMapping(value = "/studies", produces = { "application/json" }, method = RequestMethod.GET)
	ResponseEntity<StudyListResponse> studiesGet(
			@ApiParam(value = "commonCropName") @Valid @RequestParam(value = "commonCropName", required = false) String commonCropName,
			@ApiParam(value = "studyType") @Valid @RequestParam(value = "studyType", required = false) String studyType,
			@ApiParam(value = "programDbId") @Valid @RequestParam(value = "programDbId", required = false) String programDbId,
			@ApiParam(value = "locationDbId") @Valid @RequestParam(value = "locationDbId", required = false) String locationDbId,
			@ApiParam(value = "seasonDbId") @Valid @RequestParam(value = "seasonDbId", required = false) String seasonDbId,
			@ApiParam(value = "trialDbId") @Valid @RequestParam(value = "trialDbId", required = false) String trialDbId,
			@ApiParam(value = "studyDbId") @Valid @RequestParam(value = "studyDbId", required = false) String studyDbId,
			@ApiParam(value = "studyName") @Valid @RequestParam(value = "studyName", required = false) String studyName,
			@ApiParam(value = "studyCode") @Valid @RequestParam(value = "studyCode", required = false) String studyCode,
			@ApiParam(value = "studyPUI") @Valid @RequestParam(value = "studyPUI", required = false) String studyPUI,
			@ApiParam(value = "germplasmDbId") @Valid @RequestParam(value = "germplasmDbId", required = false) String germplasmDbId,
			@ApiParam(value = "observationVariableDbId") @Valid @RequestParam(value = "observationVariableDbId", required = false) String observationVariableDbId,
			@ApiParam(value = "active") @Valid @RequestParam(value = "active", required = false) Boolean active,
			@ApiParam(value = "sortBy") @Valid @RequestParam(value = "sortBy", required = false) String sortBy,
			@ApiParam(value = "sortOrder") @Valid @RequestParam(value = "sortOrder", required = false) String sortOrder,
			@ApiParam(value = "externalReferenceId") @Valid @RequestParam(value = "externalReferenceId", required = false) String externalReferenceId,
			@ApiParam(value = "externalReferenceID") @Valid @RequestParam(value = "externalReferenceID", required = false) String externalReferenceID,
			@ApiParam(value = "externalReferenceSource") @Valid @RequestParam(value = "externalReferenceSource", required = false) String externalReferenceSource,
			@ApiParam(value = "page") @Valid @RequestParam(value = "page", required = false) Integer page,
			@ApiParam(value = "pageSize") @Valid @RequestParam(value = "pageSize", required = false) Integer pageSize,
			@ApiParam(value = "HTTP HEADER - Token used for Authorization   <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization)
			throws BrAPIServerException;

	@ApiOperation(value = "Create new Studies.", nickname = "studiesPost", notes = "Create new studies  Implementation Notes  StartDate and endDate should be ISO-8601 format for dates  `studDbId` is generated by the server.", response = StudyListResponse.class, authorizations = {
			@Authorization(value = "AuthorizationToken") }, tags = { "Studies", })
	@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = StudyListResponse.class),
			@ApiResponse(code = 400, message = "Bad Request", response = String.class),
			@ApiResponse(code = 401, message = "Unauthorized", response = String.class),
			@ApiResponse(code = 403, message = "Forbidden", response = String.class) })
	@RequestMapping(value = "/studies", produces = { "application/json" }, consumes = {
			"application/json" }, method = RequestMethod.POST)
	ResponseEntity<StudyListResponse> studiesPost(@ApiParam(value = "") @Valid @RequestBody List<StudyNewRequest> body,
			@ApiParam(value = "HTTP HEADER - Token used for Authorization   <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization)
			throws BrAPIServerException;

	@ApiOperation(value = "Get the details for a specific Study", nickname = "studiesStudyDbIdGet", notes = "Retrieve the information of the study required for field data collection  An additionalInfo field was added to provide a controlled vocabulary for less common data fields.", response = StudySingleResponse.class, authorizations = {
			@Authorization(value = "AuthorizationToken") }, tags = { "Studies", })
	@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = StudySingleResponse.class),
			@ApiResponse(code = 400, message = "Bad Request", response = String.class),
			@ApiResponse(code = 401, message = "Unauthorized", response = String.class),
			@ApiResponse(code = 403, message = "Forbidden", response = String.class),
			@ApiResponse(code = 404, message = "Not Found", response = String.class) })
	@RequestMapping(value = "/studies/{studyDbId}", produces = { "application/json" }, method = RequestMethod.GET)
	ResponseEntity<StudySingleResponse> studiesStudyDbIdGet(
			@ApiParam(value = "Identifier of the study. Usually a number, could be alphanumeric.", required = true) @PathVariable("studyDbId") String studyDbId,
			@ApiParam(value = "HTTP HEADER - Token used for Authorization   <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization)
			throws BrAPIServerException;

	@ApiOperation(value = "Update an existing Study", nickname = "studiesStudyDbIdPut", notes = "Update an existing Study with new data", response = StudySingleResponse.class, authorizations = {
			@Authorization(value = "AuthorizationToken") }, tags = { "Studies", })
	@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = StudySingleResponse.class),
			@ApiResponse(code = 400, message = "Bad Request", response = String.class),
			@ApiResponse(code = 401, message = "Unauthorized", response = String.class),
			@ApiResponse(code = 403, message = "Forbidden", response = String.class),
			@ApiResponse(code = 404, message = "Not Found", response = String.class) })
	@RequestMapping(value = "/studies/{studyDbId}", produces = { "application/json" }, consumes = {
			"application/json" }, method = RequestMethod.PUT)
	ResponseEntity<StudySingleResponse> studiesStudyDbIdPut(
			@ApiParam(value = "Identifier of the study. Usually a number, could be alphanumeric.", required = true) @PathVariable("studyDbId") String studyDbId,
			@ApiParam(value = "") @Valid @RequestBody StudyNewRequest body,
			@ApiParam(value = "HTTP HEADER - Token used for Authorization   <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization)
			throws BrAPIServerException;

	@ApiOperation(value = "Submit a search request for Studies", nickname = "searchStudiesPost", notes = "Get list of studies StartDate and endDate should be ISO-8601 format for dates See Search Services for additional implementation details.", response = StudyListResponse.class, authorizations = {
			@Authorization(value = "AuthorizationToken") }, tags = { "Studies", })
	@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = StudyListResponse.class),
			@ApiResponse(code = 202, message = "Accepted", response = Model202AcceptedSearchResponse.class),
			@ApiResponse(code = 400, message = "Bad Request", response = String.class),
			@ApiResponse(code = 401, message = "Unauthorized", response = String.class),
			@ApiResponse(code = 403, message = "Forbidden", response = String.class) })
	@RequestMapping(value = "/search/studies", produces = { "application/json" }, consumes = {
			"application/json" }, method = RequestMethod.POST)
	ResponseEntity<? extends BrAPIResponse> searchStudiesPost(
			@ApiParam(value = "Study Search request") @Valid @RequestBody StudySearchRequest body,
			@ApiParam(value = "HTTP HEADER - Token used for Authorization   <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization)
			throws BrAPIServerException;

	@ApiOperation(value = "Get the results of a Studies search request", nickname = "searchStudiesSearchResultsDbIdGet", notes = "Get list of studies  StartDate and endDate should be ISO-8601 format for dates  See Search Services for additional implementation details.", response = StudyListResponse.class, authorizations = {
			@Authorization(value = "AuthorizationToken") }, tags = { "Studies", })
	@ApiResponses(value = { @ApiResponse(code = 200, message = "OK", response = StudyListResponse.class),
			@ApiResponse(code = 202, message = "Accepted", response = Model202AcceptedSearchResponse.class),
			@ApiResponse(code = 400, message = "Bad Request", response = String.class),
			@ApiResponse(code = 401, message = "Unauthorized", response = String.class),
			@ApiResponse(code = 403, message = "Forbidden", response = String.class),
			@ApiResponse(code = 404, message = "Not Found", response = String.class) })
	@RequestMapping(value = "/search/studies/{searchResultsDbId}", produces = {
			"application/json" }, method = RequestMethod.GET)
	ResponseEntity<? extends BrAPIResponse> searchStudiesSearchResultsDbIdGet(
			@ApiParam(value = "Permanent unique identifier which references the search results", required = true) @PathVariable("searchResultsDbId") String searchResultsDbId,
			@ApiParam(value = "page") @Valid @RequestParam(value = "page", required = false) Integer page,
			@ApiParam(value = "pageSize") @Valid @RequestParam(value = "pageSize", required = false) Integer pageSize,
			@ApiParam(value = "HTTP HEADER - Token used for Authorization   <strong> Bearer {token_string} </strong>") @RequestHeader(value = "Authorization", required = false) String authorization)
			throws BrAPIServerException;

}
